Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Hello,
I am working on invoices for my employer. Each row in the spreadsheet has a calculated value. When the calculated value in the row = 0, then I am to 'hide' the row. If the calculated value is not =0, (could be positive or negative), then I am to display or 'unhide' the row. Does anyone know how to do this? Macros and VBA responses are ok. :) -- Thank you, Electricbluelady |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Electricbluelady,
Select the cells with the values (including the header row), then use Data / Filters.... AutoFilter. Select the dropdown on the header cell, then choose Custom, Does Not Equal, and enter a 0 into the right hand box. Press OK and you are done. HTH, Bernie MS Excel MVP "electricbluelady" wrote in message ... Hello, I am working on invoices for my employer. Each row in the spreadsheet has a calculated value. When the calculated value in the row = 0, then I am to 'hide' the row. If the calculated value is not =0, (could be positive or negative), then I am to display or 'unhide' the row. Does anyone know how to do this? Macros and VBA responses are ok. :) -- Thank you, Electricbluelady |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Hi,
Try this macro: Sub HideZeros() A = 1 'Start Row B = 1 'Calculated Value Column C = 1 'Any Column which has text data in each row Do Until Cells(A, C) = "" If Cells(A, B).Value = 0 Then Rows(A).EntireRow.Hidden = True A = A + 1 Loop End Sub You will have to change the values of A, B, C to suit your data. A is your first Row of data (Row number) B is the Column Number of your calculated value. This needs to be a number, not a letter. eg, enter 5 for Column E C is any column that has text for every row of your data. The macro continuously checks this column for data. When it finds a blank, it will stop. As above, enter the Column number, not the letter. This macro just runs once, hiding rows with zero in the critical cell. If you want a row to hide as soon as its critical cell becomes zero, then you need an event macro, which can also be done. Regards - Dave. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hiding files in the same spreadsheet | Excel Discussion (Misc queries) | |||
pivot table formulas for calculated field or calculated item | Excel Discussion (Misc queries) | |||
Calculated Link to Another Spreadsheet | Excel Discussion (Misc queries) | |||
User form and hiding spreadsheet | Excel Discussion (Misc queries) | |||
PIVOT TABLE - hiding records with CALCULATED item values equal to | Excel Discussion (Misc queries) |