Hide rows depending on content...

G

Gord

Is there a way to hide a row of a sheet unless there is something in a
certain cell?

I have a list of CountIF's and some of the cells are blank to have
built in expansion. Until the items are entered, I just have white
space.

Could I set something along these lines:

If cell A25 = BLANK HIDE row, otherwise show row?

Thanks in advance.
 
B

Bob Phillips

Dim iLastRow As Long
Dim i As Long
iLastRow = Cells(Rows.Count, "A").End(xlUp).row
For i = 1 To iLastRow
If Cells(i, "A").Value = "" Then
Rows(i).Hidden = True
End If
Next i
 

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