Hiding a column depending on cell value

PaulKav

New Member
Joined
Mar 14, 2011
Messages
14
I am looking for help with a macro. I need a macro to hide the column if a certain cell in the column has a "Yes".

For example if Yes is entered into cell A20, the column A is hidden.

Any help much appreciated.

Thanks.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
How would I do this If I needed this to happen for each column when "Yes" is entered in cell 20 in each column.

E.g hide column B where "Yes" is entered in B20; hide column E where "Yes" is entered in E20.

Sorry if I'm not explaining this correctly.

Thanks.
 
Upvote 0
Another slant....alternatively if I wanted to protect the column in the same fashion as above how would I do this.

Any help appreciated.

Thanks
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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