Auto Hide Rows in which multiple columns contain value of 0

Jack3h

New Member
Joined
Jan 19, 2022
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hello,

I am trying to figure out how to Auto hide rows in a table based on the criteria that Columns B,C,D & E contain a value of zero. (I also have another sheet that I would want to do the exact same thing but with B,C,D,E,F & G containing a value of zero). And if possible only on the rows that contain the tables.

The cells contain an IFERROR formula that returns a 0 if no data is fetched.

I'm assuming I will need to use a "Private Sub Worksheet_Calculate()" but so far all the ones I have tried have given me issues.

If possible I would also want it to Auto unhide the rows when the data is changed and the value in either of those columns is no longer Zero.

Is this a possible thing to do? This is my first post so bare with me if the explanation is not thorough enough.

Thanks!

C-Store Financial MCE test.xlsm
ABCDEFG
5NovemberNovember
620212020Year over Year Difference
7OTHER INCOME & EXPENSEMONTHYTDMONTH YTD MONTH YTD
8FISHING/HUNTING LICENSE SALES$ -$ -$ -$ -$ -$ -
9TRASH STICKERS SALES$ -$ -$ -$ -$ -$ -
10RENTAL INCOME$ -$ -$ -$ -$ -$ -
11ATM INCOME$ 638.40$ 6,823.40$ 590.24$ 6,521.64$ 48.16$ 301.76
12MISCELLANEOUS INCOME$ 727.27$ 877.27$ -$ -$ 727.27$ 877.27
13LOTTERY COMMISSIONS$ 6,024.58$ 61,136.54$ 3,343.58$ 45,630.99$ 2,681.00$ 15,505.55
14PULL TABS COMMISSION$ 1,200.00$ 5,494.16$ 959.04$ 10,787.16$ 240.96$ (5,293.00)
15PROMOTIONAL INCOME$ 227.99$ 5,538.93$ 184.91$ 1,837.64$ 43.08$ 3,701.29
16TOBACCO PROMOTIONAL INCOME$ 186.50$ 20,371.41$ 219.15$ 4,250.00$ (32.65)$ 16,121.41
17ENERGY/LIGHT ALLOWANCE INCOME$ -$ -$ -$ -$ -$ -
18PHONE CARD GPM$ 0.09$ 5.33$ 1.44$ 45.96$ (1.35)$ (40.63)
19COUPON HANDLING INCOME$ -$ 43.52$ 10.24$ 61.28$ (10.24)$ (17.76)
20PHONE CARD SALES$ 40.00$ 884.99$ 180.00$ 1,305.00$ (140.00)$ (420.01)
21GIFT CARD INCOME$ 275.00$ 3,120.00$ 195.00$ 1,385.00$ 80.00$ 1,735.00
22GAIN/LOSS ON SALE OF ASSETS$ -$ -$ -$ -$ -$ -
23OHIO SALES TAX DISCOUNT$ 34.25$ 391.23$ 30.57$ 363.97$ 3.68$ 27.26
24FISHING/HUNTING LICENSE PURCHA$ -$ -$ -$ -$ -$ -
25TRASH STICKERS PURCHASES$ -$ -$ -$ -$ -$ -
26PHONE CARD EXPENSE $ (40.00)$ (884.99)$ (180.00)$ (1,305.00)$ 140.00$ 420.01
27GIFT CARD EXPENSE$ (275.00)$ (3,345.00)$ (220.00)$ (1,600.00)$ (55.00)$ (1,745.00)
28SALES TAX EXPENSE$ 0.15$ 13.72$ (0.27)$ 1.07$ 0.42$ 12.65
29FUEL CLEANUP$ (28.13)$ 8,825.20$ -$ -$ (28.13)$ 8,825.20
30INVOICE ERRORS$ 0.12$ 751.84$ 0.36$ 47.95$ (0.24)$ 703.89
31TOTAL OTHER INCOME & EXPENSE$ 9,011.22$ 110,047.55$ 5,314.26$ 69,332.66$ 3,696.96$ 40,714.89
OTHER INC. EXP.
Cell Formulas
RangeFormula
B5:B6,D5:D6B5='Data-OH'!B18
B8:B30B8=IFERROR(INDEX('Data-OH'!B:B,MATCH(A8,'Data-OH'!A:A,0)),0)
C8:C30C8=IFERROR(INDEX('Data-OH'!C:C,MATCH(A8,'Data-OH'!A:A,0)),0)
D8:D30D8=IFERROR(INDEX('Data-OH'!D:D,MATCH(A8,'Data-OH'!A:A,0)),0)
E8:E30E8=IFERROR(INDEX('Data-OH'!E:E,MATCH(A8,'Data-OH'!A:A,0)),0)
F8:G30F8=B8-D8
B31B31=SUBTOTAL(109,[MONTH])
C31C31=SUBTOTAL(109,[YTD])
D31D31=SUBTOTAL(109,[[MONTH ]])
E31E31=SUBTOTAL(109,[[YTD ]])
F31F31=SUBTOTAL(109,[[MONTH ]])
G31G31=SUBTOTAL(109,[[YTD ]])
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F8:G31Cell Value<0textNO
F8:G31Cell Value>0textNO
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Nevermind, I have already come to a solution using a "Sub worksheet_change" function and some other formulas.
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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