How to hide/unhide certain cells using checkbox

kares

New Member
Joined
Dec 10, 2024
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
Hi, I'm trying to find a macro code to hide/unhide certain/selected cells only using the checkbox. For example, if I tick the checkbox, it will show cells "A4:D9" but when I unchecked it, the mentioned cells will be hidden.

Attached is a sample of my query. The shaded parts are the ones supposed to hide/unhide.

Thanks a lot!
 

Attachments

  • sample.jpg
    sample.jpg
    17 KB · Views: 9

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Welcome to the MrExcel board!

You cannot hide just 24 cells. If you want those cells hidden then you must either ...
  1. Hide all of rows 4:9, or
  2. Hide all of columns A:D
Which do you want?
 
Upvote 0
Welcome to the MrExcel board!

You cannot hide just 24 cells. If you want those cells hidden then you must either ...
  1. Hide all of rows 4:9, or
  2. Hide all of columns A:D
Which do you want?
oh, I see. It would be nice if I could hide/unhide certain cells but if that isn't possible, that's okay. I already opted to hide the rows instead. Thanks by the way.
 
Upvote 0
You're welcome. Sorry I couldn't do what you wanted.

Rather than physically hide the actual cells, would an option be to mask whatever is in those cells by making the text and background cell colour the same?
.. or the checkbox code could cover/uncover the cells with a solid colour rectangle?
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

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