This is my first VBA program and I am trying to use the for loop counter variable inside an if statement as the number of a cell. I think you should get the idea from the code I wrote below:
Private Sub Worksheet_Change(ByVal Target As Range)
For i = 3 To 1000
If Range("Ai") = "Next" Then
Rows("i").EntireRow.Hidden = True
Else
Rows("i").EntireRow.Hidden = False
End If
Next i
End Sub
What is the correct syntax to do this?
Bookmarks