Hi there,
When I run this code I get the compile error "next without for" and I can't figure out why
Thanks for your help - I just can't see what I'm overlooking.
When I run this code I get the compile error "next without for" and I can't figure out why
Code:
Sub Find_Class_A1_then_Hide()
Application.ScreenUpdating = False
Dim r, Lastrow, cLastrow, tRow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For r = 1 To Lastrow
cLastrow = Cells(r + 6, "E").End(xlDown).Row
tRow = r - 4
MsgBox ("r= " & r & " - " & "cLastrow = " & cLastrow)
If Cells(r, "C") = "Basic I" Then
Rows(2).Hidden = True
Rows(tRow & ":" & cLastrow).Hidden = True
Next r
Application.ScreenUpdating = True
End Sub