View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JustMe JustMe is offline
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!