I am creating a button in excel to hide any rows that are missing data in the first column. I've got the code worked out I believe, but I can't make the button work. The code is as followed:
Sub Button74_Click()
For Each r In Range("A10:A164")
If r.Value = "True" Then
r.EntireRow.Hidden = True
Else
r.EntireRow.Hidden = False
End If
End Sub
I keep getting the error message "Compile Error: For without Next". I'm not sure what this means or how to fix it. Can somebody help?
Sub Button74_Click()
For Each r In Range("A10:A164")
If r.Value = "True" Then
r.EntireRow.Hidden = True
Else
r.EntireRow.Hidden = False
End If
End Sub
I keep getting the error message "Compile Error: For without Next". I'm not sure what this means or how to fix it. Can somebody help?