Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Hide Rows based on value, but not using autofilter

Hi, I have seen a number of posts on this but still can't quite get
what I want.

I have a sheet with maybe 20 rows at the top with statistics in, that
I need to display. Then below here is my actual data. I have a
column with from row 21 down with TRUE or FALSE in. On the click of a
button I want to change the sheet so that all rows with FALSE in are
hidden. I cant use autofilter as this also hides the rows at the
top. I have a named range for the column which has TRUE or FALSE in,
and so have the following code, but it does not work:

Range("DisplayStart").Activate
For Each c In Range("DisplayRange")
If c.Value = "FALSE" Then
c.Select
c.EntireRow.Hidden = True
End If
Next

Any ideas please?

Cheers

Rich
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default Hide Rows based on value, but not using autofilter

Are the TRUE and FALSE entries text or actual True/False values? If they are
actual True/False values and you are testing for the text "FALSE", the macro
won't find any. Try this:

Dim c As Range
For Each c In Range("DisplayRange")
If c.Value = False Then
c.EntireRow.Hidden = True
End If
Next

Hope this helps,

Hutch

"Richhall" wrote:

Hi, I have seen a number of posts on this but still can't quite get
what I want.

I have a sheet with maybe 20 rows at the top with statistics in, that
I need to display. Then below here is my actual data. I have a
column with from row 21 down with TRUE or FALSE in. On the click of a
button I want to change the sheet so that all rows with FALSE in are
hidden. I cant use autofilter as this also hides the rows at the
top. I have a named range for the column which has TRUE or FALSE in,
and so have the following code, but it does not work:

Range("DisplayStart").Activate
For Each c In Range("DisplayRange")
If c.Value = "FALSE" Then
c.Select
c.EntireRow.Hidden = True
End If
Next

Any ideas please?

Cheers

Rich
.

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
Hide & Show Rows based on Check Boxes loza Excel Discussion (Misc queries) 1 September 14th 08 01:49 AM
Macro to Hide rows based on value of column F Scott Marcus Excel Discussion (Misc queries) 10 October 27th 06 11:57 PM
Hide Rows based on value SteveT Excel Discussion (Misc queries) 0 June 27th 06 11:00 PM
hide rows based on cell value dummster New Users to Excel 1 February 15th 06 11:37 PM
hide rows based on value in cell dummster Excel Discussion (Misc queries) 0 February 15th 06 03:27 PM


All times are GMT +1. The time now is 02:45 AM.

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"