Trying to hide columns using a checkbox

Schotzz

New Member
Joined
May 10, 2005
Messages
44
I am having a little trouble hiding several columns on a sheet using a checkbox to hide when checked and to unhide when unchecked. Is there an easy way to do this? I have tried some suggestions from people on here but nothing seems to work as of yet.

Thanks for any help you can provide.
 

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
How's this (using an ActiveX Check Box):

Code:
Private Sub CheckBox1_Click()
    Columns("H:K").EntireColumn.Hidden = Not Columns("H:K").EntireColumn.Hidden
End Sub

HTH,

SMitty
 

Watch MrExcel Video

Forum statistics

Threads
1,113,918
Messages
5,545,025
Members
410,647
Latest member
bernardazar
Top