Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter Bold Cells VBA Teddy-B Excel Discussion (Misc queries) 2 February 20th 09 05:33 PM
Hide only rows that are not bold? kczmatthews Excel Discussion (Misc queries) 2 July 16th 08 06:32 PM
How can I have formatting options like merge cells ,Bold,active for the unlocked cells of the protected worksheet.Is it possible in excel? divya Excel Programming 2 July 20th 06 02:04 PM
how to select cells that are bold? Elizabeth Excel Discussion (Misc queries) 1 April 2nd 06 07:10 PM
Show or hide rows when text is bold or italic Sophisticated Penguin Excel Programming 4 December 1st 04 09:45 AM


All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"