Hide rows with value "Hours"

J

jswilli1

I would like to toggle rows to hide/unhide based on the value "Hours"
in column B. I think filtering is an issue to some blank seperator
rows and merged cell headings. There are no merged cells involving
Column B. Thanks.
 
B

Bob Phillips

Public Sub ProcessData()
Const TEST_COLUMN As String = "B" '<=== change to suit
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).row

For i = 1 To iLastRow
.Rows(i).Hidden = .Cells(i, TEST_COLUMN).Value = "Hours"
Next i

End With

End Sub


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 

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