LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Hide rows

Thanks for the feedback Patti.

You can learn all sorts of neat stuff on these Excel groups, like how to
re-arrange your siding<g

Gord

On Wed, 7 Jul 2004 01:01:58 -0500, "Patti" wrote:

Thanks for the enlightenment gentlemen!

Patti


"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
Norman

I was thinking that some rows may already be hidden manually and may not

get
picked up if bold.

Missed the Else line that looks after that.

Having a bad day.

Ladies day at the golf course and I am missing my "fix".

Maybe go out and pound a bucket of balls into the side of the house.

Thanks, Gord

On Tue, 6 Jul 2004 23:03:35 +0100, "Norman Jones"
wrote:

Hi Gord,

Add William's unhide all rows to start(just in case) and we get....

I think that this is already covered by the existing else condition:

Else
rngCell.EntireRow.Hidden = False
End If

---
Regards,
Norman

I think tha
"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
Norman

Looking gooder all the time.

Hides rows if no cell in E through H is bolded.

Ignores all other columns.

Add William's unhide all rows to start(just in case) and we get....

Sub HideRows()
Dim rngCell As Range
With ActiveSheet
Intersect(.UsedRange, _
.Columns("E:H")).EntireRow.Hidden = False
End With
For Each rngCell In Intersect(ActiveSheet.UsedRange, _
ActiveSheet.Columns("E"))
If rngCell.Resize(1, 4).Font.Bold = False Then
rngCell.EntireRow.Hidden = True
Else
rngCell.EntireRow.Hidden = False
End If
Next
End Sub

Gord

On Tue, 6 Jul 2004 19:45:33 +0100, "Norman Jones"
wrote:

Hi Gord,

I think that this fails where there are no bold cells in a row's

column
E:H
range, while there are bold cells in one other column(s) on the row.

Adapting your approach (which is more elegant than mine):

Sub HideRows()
Dim rngCell As Range
For Each rngCell In Intersect(ActiveSheet.UsedRange, _
ActiveSheet.Columns("E"))
If rngCell.Resize(1, 4).Font.Bold = False Then
rngCell.EntireRow.Hidden = True
Else
rngCell.EntireRow.Hidden = False
End If
Next
End Sub


---
Regards,
Norman

"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
Patti

You are testing each cell in the range. If any cell in column E
through H
is
not Bold, the row will be hidden.

Try this........

Sub test()
For Each rngcell In Intersect(ActiveSheet.UsedRange, _
ActiveSheet.Columns("e:h"))
If rngcell.EntireRow.Font.Bold = False Then
rngcell.EntireRow.Hidden = True
End If
Next
End Sub

Gord Dibben Excel MVP

On Mon, 5 Jul 2004 23:17:18 -0500, "Patti"

wrote:

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.









 
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
Group rows (or hide rows) like in MS Project Annie1904 Excel Worksheet Functions 2 October 17th 09 05:15 AM
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
cut rows without cutting hide rows מיכל Excel Discussion (Misc queries) 1 June 25th 07 02:01 PM
Hide Rows - copy and paste only rows that show Access101 Excel Worksheet Functions 3 March 1st 06 12:39 AM


All times are GMT +1. The time now is 07:52 AM.

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

About Us

"It's about Microsoft Excel"