"end if without block if" hatası

Katılım
5 Haziran 2006
Mesajlar
255
Excel Vers. ve Dili
Office 2010 Türkçe
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
 

Ekli dosyalar

  • 23 KB Görüntüleme: 1
Katılım
26 Kasım 2012
Mesajlar
750
Excel Vers. ve Dili
Excel 2007 Türkçe
If Sheets("Sayfa1").Range("G2").Value = Sheets("Sayfa1").Cells(x + 1, 1).Value Then

bu ifadede then den sonra gelen komutu bir alt satıra alınız..
 
Katılım
5 Haziran 2006
Mesajlar
255
Excel Vers. ve Dili
Office 2010 Türkçe
If Sheets("Sayfa1").Range("G2").Value = Sheets("Sayfa1").Cells(x + 1, 1).Value Then

bu ifadede then den sonra gelen komutu bir alt satıra alınız..
Teşekkürler hocam. Bu koşullar ve döngü ile ilgili örnekleri alabileceğim bir link var mı?
 
Katılım
26 Kasım 2012
Mesajlar
750
Excel Vers. ve Dili
Excel 2007 Türkçe
rica ederim..site içinde birçok örnek mevcuttur..arama yaparak bulabilirsiniz..
 
Üst