Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Macro to hide rows based on a zero value in a particular cell

How complicated is it to create a macro to hide rows
conditioned upon a zero value in a particular column of
that row? Could a second condition also be added to test
for bold font type zeros to not be hidden? I have a VERY
large cost estimating spreadsheet with 2,000 rows of
items, and want to be able to hide rows that do not
apply. Summary rows are in bold type and I would like to
retain them, but hide all the detail. It takes forever
manually!.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Macro to hide rows based on a zero value in a particular cell

Just adopted something from the group. Sorry can't remember name



'make cells dispapear
Sub Button1_Click()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Range("A1:A60")

If cell.Font.Bold = False Then
If cell.Value = 0 Then
cell.EntireRow.Hidden = True
ElseIf cell.Value < 0 Then
cell.EntireRow.Hidden = False
End If
End If
Next
Application.ScreenUpdating = True

End Sub

'make all cells reappear
Sub Button2_Click()
Dim cell As Range

For Each cell In Range("A1:A60")
cell.EntireRow.Hidden = False
Next
Application.ScreenUpdating = True

End Sub



"Peter" wrote in message
...
How complicated is it to create a macro to hide rows
conditioned upon a zero value in a particular column of
that row? Could a second condition also be added to test
for bold font type zeros to not be hidden? I have a VERY
large cost estimating spreadsheet with 2,000 rows of
items, and want to be able to hide rows that do not
apply. Summary rows are in bold type and I would like to
retain them, but hide all the detail. It takes forever
manually!.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro to hide rows based on a zero value in a particular cell

Hi Peter,

Have a look at "Outline a worksheet " and at "Group Ungroup" in help. This
feature could very well do exactly what you want and would enable you to
click between various hierarchical data levels revealing or hiding support
data.



Also, look to use the AutoFilter and Advanced Filters.



---
Regards,
Norman




"Peter" wrote in message
...
How complicated is it to create a macro to hide rows
conditioned upon a zero value in a particular column of
that row? Could a second condition also be added to test
for bold font type zeros to not be hidden? I have a VERY
large cost estimating spreadsheet with 2,000 rows of
items, and want to be able to hide rows that do not
apply. Summary rows are in bold type and I would like to
retain them, but hide all the detail. It takes forever
manually!.



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
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 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
How to Hide Rows based on conditional value in cell Nick Excel Programming 1 May 21st 04 11:16 AM
macro to hide rows based on formula? Scott T. Lindner Excel Programming 5 October 20th 03 01:40 PM


All times are GMT +1. The time now is 05:10 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"