macro to hide a row when a cell contains a value

I

InfoNeeded

I have an excel sheet that contains multiple rows. I want to be able to
hide/unhide the rows that contain "C" (complete) when there is a "C" in
column P when I click on the command button that contains the macro
 
G

Gary''s Student

Sub HideMe()
n = Cells(Rows.Count, "P").End(xlUp).Row
For i = 1 To n
If Cells(i, "P").Value = "C" Then
Rows(i).EntireRow.Hidden = True
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top