Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Hide rows based on value of column F | Excel Discussion (Misc queries) | |||
hide rows based on cell value | New Users to Excel | |||
hide rows based on value in cell | Excel Discussion (Misc queries) | |||
How to Hide Rows based on conditional value in cell | Excel Programming | |||
macro to hide rows based on formula? | Excel Programming |