PDA

View Full Version : Hide Rows Based on Condition



Sir Babydum GBE
03-18-2008, 02:23 AM
Hi

On a certain worksheet I want to hide rows where the #NUM! error appears in column H. I only need to look as far as row 150.

Please help. The security of Cardiff is at stake.

Thanks

Sir BD

Bob Phillips
03-18-2008, 02:42 AM
Wessex man to the rescue



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

With ActiveSheet

For i = 1 To 150

.Rows(i).Hidden = .Cells(i, TEST_COLUMN).Text = "#NUM!"
Next i
End With

End Sub

Sir Babydum GBE
03-18-2008, 02:58 AM
Wessex man to the rescue

Phew

Cardiff can breath a sigh of relief! I'll be sure to let the mayor know.

Cheers Bob - perfect!