Why am I getting this error when I have "Do" in the code?
Sub Issue()
Range("A2").Select
Do While ActiveCell.Value <> ""
ActiveCell.Offset(1, 0).Select
If ActiveCell = "" Then
Selection.EntireRow.Hidden = True
Loop
End If
End Sub
Yup - any attempt to finish a loop (either DO, While or Next) within an IF or a WITH block will give this error. WITHS and IFS should be either entirely INSIDE or entirely OUTSIDE any loop
Rgds, Geoff
"Three things are certain: Death, taxes and lost data. Guess which has occurred"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.