Thread
:
Hide rows
View Single Post
#
2
Posted to microsoft.public.excel.programming
William[_2_]
external usenet poster
Posts: 227
Hide rows
Hi Patti
Your code works although I'd be inclined to amend it with the following....
Sub test()
Dim rngcell As Range
Application.ScreenUpdating = False
With ActiveSheet
Intersect(.UsedRange, _
..Columns("e:h")).EntireRow.Hidden = False
For Each rngcell In Intersect(.UsedRange, _
..Columns("e:h"))
If rngcell.Font.Bold = False Then _
rngcell.EntireRow.Hidden = True
Next rngcell
End With
Application.ScreenUpdating = True
End Sub
--
XL2002
Regards
William
"Patti" wrote in message
...
| Can anyone explain to me why this doesn't work? I am trying to filter a
| sheet so that I am only viewing rows that have a bolded cell anywhere in
| columns E:H. The code is hiding all rows in the worksheet.
|
| Sub test()
|
| For Each rngCell In Intersect(ActiveSheet.UsedRange,
| ActiveSheet.Columns("e:h"))
| If rngCell.Font.Bold = False Then
| rngCell.EntireRow.Hidden = True
| End If
| Next
|
| End Sub
|
| Thanks in advance.
|
|
|
Reply With Quote
William[_2_]
View Public Profile
Find all posts by William[_2_]