Macro to hide rows based on result of formula with exceptions

boilermaker1997

New Member
Joined
Sep 20, 2007
Messages
41
I need a macro very similar to the one in this thread: http://www.mrexcel.com/forum/showthread.php?t=534188&highlight=hide+rows+based+criteria

The only modification that I need is that I would like a list of exceptions that can be added to the macro.

Here is my specific example. I have a list of general ledger accounts with varying data including account name and account balance among other things. I would like to hide the rows where the values are zero with the exception of some accounts whose balance is always zero.

Example:
Column A Column B Column C Column D
Row1 Account Name Account Balance Account Type Account Num
Row2 Cash $1,000 Asset 1001
Row3 Cash Clearing $0 Asset 1002
Row4 Office Equip $0 Asset 1003
Row5 Supplies $50 Asset 1004

In the example above, I would like to hide row 4 because the value is zero, but keep row 3 because it would be included in my exceptions list. For practical use, the list of accounts would be much longer and the exception list would contain more than one value. Essentially, I would like a macro that would hide all rows containing zero in column B, but have the ability to create some exceptions to that rule.

Any ideas?

Matt
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,548
Messages
6,179,451
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top