Hi All,
I'm a complete beginner to all this so please be gentle...
when i try to run this code it tells me that there's a compile error - Loop without Do. Where am i going wrong?
Sub Button6_Click()
Dim Counter As Integer
Counter = 2
Do While ThisWorkbook.Sheets("Obs Sheet").Cells(Counter, 15).Value <> ""
ThisWorkbook.Sheets("Annex B").Range("J8:X8").Value = ThisWorkbook.Sheets("Obs Sheet").Range("O" & Counter).Value
If ThisWorkbook.Sheets("Annex B").Range("AT5").Value = "Y" Then
ThisWorkbook.Sheets("Annex B").Range("AS3:AS103").AutoFilter Field:=1, Criteria1:="Y"
MsgBox "Printed press OK to continue!"
Else
ThisWorkbook.Sheets("Annex B").Range("AS3:AS103").AutoFilter Field:=1
MsgBox "Did Not Print, press OK to continue!"
Counter = Counter + 1
Loop
End Sub
I'm a complete beginner to all this so please be gentle...
when i try to run this code it tells me that there's a compile error - Loop without Do. Where am i going wrong?
Sub Button6_Click()
Dim Counter As Integer
Counter = 2
Do While ThisWorkbook.Sheets("Obs Sheet").Cells(Counter, 15).Value <> ""
ThisWorkbook.Sheets("Annex B").Range("J8:X8").Value = ThisWorkbook.Sheets("Obs Sheet").Range("O" & Counter).Value
If ThisWorkbook.Sheets("Annex B").Range("AT5").Value = "Y" Then
ThisWorkbook.Sheets("Annex B").Range("AS3:AS103").AutoFilter Field:=1, Criteria1:="Y"
MsgBox "Printed press OK to continue!"
Else
ThisWorkbook.Sheets("Annex B").Range("AS3:AS103").AutoFilter Field:=1
MsgBox "Did Not Print, press OK to continue!"
Counter = Counter + 1
Loop
End Sub