Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide row is no cells are bold
How would I hide any rows in my worksheet if there is *not* a bold font in
column E,F, I or J? The bold font could appear in just one of these columns, or in multiple. Thanks in advance! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide row is no cells are bold
Sub HideRows()
Dim i as Long, lastrow as Long Dim cell as Range, rng as Range Dim bBold as Boolean lastrow = cells(rows.count,"E").End(xlup).Row Range("A1",Cells(lastrow,1).EntireRow.Hidden = False for i = lastrow to 1 step -1 bBold = False set rng = Cells(i,5).Range("A1:B1,E1:F1") for each cell in rng if cell.Bold then bBold = True exit for end if Next if not bBold then rows(i).Hidden = True end if Next End Sub -- Regards, Tom Ogilvy "JustMe" wrote in message ... How would I hide any rows in my worksheet if there is *not* a bold font in column E,F, I or J? The bold font could appear in just one of these columns, or in multiple. Thanks in advance! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide row is no cells are bold
hi tom:
do you need this: If cell.Font.Bold Then instead of this? if cell.Bold then -- Gary "Tom Ogilvy" wrote in message ... Sub HideRows() Dim i as Long, lastrow as Long Dim cell as Range, rng as Range Dim bBold as Boolean lastrow = cells(rows.count,"E").End(xlup).Row Range("A1",Cells(lastrow,1).EntireRow.Hidden = False for i = lastrow to 1 step -1 bBold = False set rng = Cells(i,5).Range("A1:B1,E1:F1") for each cell in rng if cell.Bold then bBold = True exit for end if Next if not bBold then rows(i).Hidden = True end if Next End Sub -- Regards, Tom Ogilvy "JustMe" wrote in message ... How would I hide any rows in my worksheet if there is *not* a bold font in column E,F, I or J? The bold font could appear in just one of these columns, or in multiple. Thanks in advance! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide row is no cells are bold
I would think so - thanks for picking that up.
-- Regards, Tom Ogilvy "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... hi tom: do you need this: If cell.Font.Bold Then instead of this? if cell.Bold then -- Gary "Tom Ogilvy" wrote in message ... Sub HideRows() Dim i as Long, lastrow as Long Dim cell as Range, rng as Range Dim bBold as Boolean lastrow = cells(rows.count,"E").End(xlup).Row Range("A1",Cells(lastrow,1).EntireRow.Hidden = False for i = lastrow to 1 step -1 bBold = False set rng = Cells(i,5).Range("A1:B1,E1:F1") for each cell in rng if cell.Bold then bBold = True exit for end if Next if not bBold then rows(i).Hidden = True end if Next End Sub -- Regards, Tom Ogilvy "JustMe" wrote in message ... How would I hide any rows in my worksheet if there is *not* a bold font in column E,F, I or J? The bold font could appear in just one of these columns, or in multiple. Thanks in advance! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide row is no cells are bold
Thanks much :)
"Tom Ogilvy" wrote in message ... I would think so - thanks for picking that up. -- Regards, Tom Ogilvy "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... hi tom: do you need this: If cell.Font.Bold Then instead of this? if cell.Bold then -- Gary "Tom Ogilvy" wrote in message ... Sub HideRows() Dim i as Long, lastrow as Long Dim cell as Range, rng as Range Dim bBold as Boolean lastrow = cells(rows.count,"E").End(xlup).Row Range("A1",Cells(lastrow,1).EntireRow.Hidden = False for i = lastrow to 1 step -1 bBold = False set rng = Cells(i,5).Range("A1:B1,E1:F1") for each cell in rng if cell.Bold then bBold = True exit for end if Next if not bBold then rows(i).Hidden = True end if Next End Sub -- Regards, Tom Ogilvy "JustMe" wrote in message ... How would I hide any rows in my worksheet if there is *not* a bold font in column E,F, I or J? The bold font could appear in just one of these columns, or in multiple. Thanks in advance! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filter Bold Cells VBA | Excel Discussion (Misc queries) | |||
Hide only rows that are not bold? | Excel Discussion (Misc queries) | |||
How can I have formatting options like merge cells ,Bold,active for the unlocked cells of the protected worksheet.Is it possible in excel? | Excel Programming | |||
how to select cells that are bold? | Excel Discussion (Misc queries) | |||
Show or hide rows when text is bold or italic | Excel Programming |