Using multiple checkboxes and cell content to hide columns

RBettina

New Member
Joined
Jan 28, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello everyone. I would like to create in VBA a code which hides columns based on their content (if cell value=0) by using multiple checkboxes. For example I will have 26 checkboxes in total and when several of them are checked in , I want to hide all columns where all cell values are 0 (in the checked in rows) if at least in one column the value (in the ckecked in rows) is higher than 0, I want to keep that column. Thank you in advance for your help.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I would need more information to understand this request.
Using a lot of checkboxes may not be the best way to do this.
So if what cell value equals 0 causes this column to be hidden?

I would suggest using a double click event.
Or cell change event script

So if I enter 0 in A1 column A will be hidden for example.
 
Upvote 0
For example if I have columns A:K, rows 1-28, and in Column A, (rows 2-28), there are 26 checkboxes. When I check in the ones in rows 2,7,11,12,25 I would like all columns from B:K to be hidden where we have in at least one row (from 2,7,11,12,25) a value higher than 0 (or the sum of values is less than 1). Thank you in advance for your help.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,397
Members
449,081
Latest member
JAMES KECULAH

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