Hi Patti
Firstly, your original code does not unhide cells which are bold, it only
hides rows that - I amended this in my code by unhiding all rows at the
start of the macro.
Secondly, your code is saying that if ANY of the 4 cells in the relevant row
of columns E to H are NOT bold, then hide the entire row. So, if cells E16
was not bold and F16, G16 and H16 were bold, then the row would be hidden -
is that what you want?
--
XL2002
Regards
William
[email protected]
| Hi William,
|
| I appreciate your interest, but the code doesn't work. As I said, it
hides
| _all_ of the rows on the worksheet. I tried your ammended code, and that
is
| hiding all of the rows as well.
|
| Any idea why? The cells are not bolded by conditional formatting, and if
I
| select one the immediate window shows:
|
| ? activecell.font.bold
| True
|
|
| Patti
|
|
| | > 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
| >
| >
[email protected]
| >
| > | > | 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.
| > |
| > |
| > |
| >
| >
|
|