What is wrong with my VBA code?
In the range D1 to D2000, if the cell is filled in light blue, I want the row to be either hidden or showing based on the sub procedure that is ran. I used a function to get the specific RGB. Unfortunately, it is not doing anything with the hiding or showing of rows.
Thanks.
Code:
Sub HideRows()
Dim Rw As Range
Worksheets("Revenue Sheet").Select
For Each Rw In Range("D1:D2000")
If Rw.Interior.Color = RGB(0, 176, 240) Then
Rw.EntireRow.Hidden = True
End If
Next Rw
End Sub
Sub ShowRows()
Dim Rw As Range
Worksheets("Revenue Sheet").Select
For Each Rw In Range("D1:D2000")
If Rw.Interior.Color = RGB(0, 176, 240) Then
Rw.EntireRow.Hidden = False
End If
Next Rw
End Sub