I have drop downs on another sheet that control cells so that if the drop down is the same as the value next to the cell it shows a 1 if not a zero.
I want to hide the rows that contain cells with a zero and have read forum answers but for some reason this isn't working. It comes up with Error 1001 object defined or application defined error and highlights
"Rows(rCell).EntireRow.Hidden = True".
Or says my argument isn't optional.
I would also like to expand this and hide irrelevant columns as well once this is cracked.
Any help is appreciated.![]()
Private Sub Worksheet_Change(ByVal Target As Range) Dim rCell, rRange As Range For Each rCell In Range("B10:B921") If rCell.Value = 0 Then Rows(rCell).EntireRow.Hidden = True End If If rCell.Value = 1 Then Rows(rCell).EntireRow.Hidden = False End If Next End Sub
Thanks
D
Moderator's Edit: Use code tags when posting code. To do so, select your code and click on the # icon above.
Bookmarks