I have written a simple macro to hide rows in a spreadsheet that contain certain text in a the column. It runs fine but doesn't consistently hide all of the rows. Sometimes I have to run it multiple times in order for it to work. Why would this be? Does anyone have any suggestions for more robust code? My code is as follows...
Sub Hide_Rows()
Dim Cell As Range
For Each Cell In Range("M6:M600")
If Cell.Value = "BUG" Then
Cell.EntireRow.Hidden = True
End If
Next
End Sub
Thank you!
Scott
Bookmarks