cjvenables
Board Regular
- Joined
- Aug 2, 2011
- Messages
- 65
Hello,
I'm trying to hide all rows on the "Retrieve" sheet that do not equal the value in cell C4 on the "Cover" Sheet. I'd like the rows to hide/unhide as the value in cell C4 changes. I tried to write some code, but it is not hiding the rows on the Retrieve sheet, just row A3 (which has no value in it).
Cell C4 on "Cover" will match Column A on the "Retrieve" sheet. I want only the matched rows to be shown.
I tried to get as far as I could, but nothing seems to work.
Thanks,
I'm trying to hide all rows on the "Retrieve" sheet that do not equal the value in cell C4 on the "Cover" Sheet. I'd like the rows to hide/unhide as the value in cell C4 changes. I tried to write some code, but it is not hiding the rows on the Retrieve sheet, just row A3 (which has no value in it).
Cell C4 on "Cover" will match Column A on the "Retrieve" sheet. I want only the matched rows to be shown.
I tried to get as far as I could, but nothing seems to work.
Thanks,
Code:
Sub Hide()
Dim rng As Range
Dim r As Range
Set rng = Sheets("Retrieve").Range("A4:A" & Range("B" & Rows.Count).End(xlUp).Row)
For Each r In rng
If r.Value <> Sheets("Cover").Range("C4").Value Then r.EntireRow.Hidden = True
Next r
End Sub