Hi,
i have my checkboxes in sheet 1, and i want to hide various columns if the checkbox is not selected in sheet 2. each checkbox is directly related to a column in sheet 2.
With Regards,
kalyan
Hi,
i have my checkboxes in sheet 1, and i want to hide various columns if the checkbox is not selected in sheet 2. each checkbox is directly related to a column in sheet 2.
With Regards,
kalyan
You will need to run a macro.
I would put it in Worksheet_Activate for sheet2.
I don't know how you decide if a checkbox is a checkbox that is attached to a column.
I also don't know how you decide which column is attached to the checkbox.
You can Name the checkboxes "ck_??" then check the name for "ck_*" and then extract the column # from the name.
Or make a table somewhere that puts the checkbox names in a column and the column # in another column.
Another option would be to assign a unique macro to each checkbox and in that macro you either hide or show the right correct column.![]()
Private Sub Worksheet_Activate() Dim ck as CheckBox For Each ck in Sheet1.CheckBoxes If <ck is a column checkbox> Then Me.Columns(<corresponding column #>).EntireColumn.Hidden = Not .Value End If Next ck End Sub
![]()
Sub CheckBox1() Sheet2.Columns(1).EntireRow.Hidden = Not Sheet1.Checkboxes(1).Value End Sub Sub CheckBox2() Sheet2.Columns(2).EntireRow.Hidden = Not Sheet1.Checkboxes(2).Value End Sub Etc.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks