Aşağıdaki kodlar "end if without block if" hatası veriyor. Sebebi ne olabilir?
Sub yazici()
Dim x As Integer
For x = 1 To 5
If Sheets("Sayfa1").Range("G2").Value = Sheets("Sayfa1").Cells(x + 1, 1).Value Then Sheets("Sayfa2").Range("B1").Value = Sheets("Sayfa1").Cells(x + 1, 1).Value
Sheets("Sayfa2").Range("B2").Value = Sheets("Sayfa1").Cells(x + 1, 2).Value
Sheets("Sayfa2").Range("B3").Value = Sheets("Sayfa1").Cells(x + 1, 3).Value
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.WindowState = xlNormal
Sheets("Sayfa1").Select
End If
Next x
End Sub
Sub yazici()
Dim x As Integer
For x = 1 To 5
If Sheets("Sayfa1").Range("G2").Value = Sheets("Sayfa1").Cells(x + 1, 1).Value Then Sheets("Sayfa2").Range("B1").Value = Sheets("Sayfa1").Cells(x + 1, 1).Value
Sheets("Sayfa2").Range("B2").Value = Sheets("Sayfa1").Cells(x + 1, 2).Value
Sheets("Sayfa2").Range("B3").Value = Sheets("Sayfa1").Cells(x + 1, 3).Value
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.WindowState = xlNormal
Sheets("Sayfa1").Select
End If
Next x
End Sub
Ekli dosyalar
-
23 KB Görüntüleme: 1
