View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
D Zandveld D Zandveld is offline
external usenet poster
 
Posts: 33
Default Hide Columns based on checkbox values

I have a 'main' worksheet which features a series of checkboxes next to
criteria in drop down boxes. They are to show\hide columns on a sheet called
"Report"

The top line is an "all" which, when selected, marks all 12 boxes as true.
Underneath on seperate lines are the 12 other checkboxes.

I want to be able to:
1. If "all" is selected, show all columns on "Report" OR
2. Based on the value of each checkbox, show or hide the related column in
"Report"

I assume that I will have to have code similar to:
Private Sub CheckBox2_Click()
Worksheets("Report").Activate
Columns("B:B").Select
Selection.EntireColumn.Hidden = True
End Sub

Or maybe

Private Sub CheckBox2_Click()
IF checkbox2 = True
Worksheets("Report").Activate
Columns("B:B").Select
Selection.EntireColumn.Hidden = True
END IF
End Sub