largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Hi again.
I have a workbook that has a sheet with a lot of columns. I also have a sheet before it which I want to put checkboxes on which will toggle columns on the second sheet hidden/unhidden.
I'm using an active X control checkbox form, but I can't figure out how to add multiple checkboxes. Is it possible? Or do I have to just create multiple individual checkboxes?
Here is the code that I'm using in the active X control:
If CheckBox1.Value = False Then
Sheets("Best").Columns("A:A").Hidden = False
Else
Sheets("Best").Columns("A:A").Hidden = True
End If
So is the only way to do this to create a lot of individual checkboxes each with this code? I was hoping I might be able to create a checkbox form that has maybe 20 checkboxes and then have them all reference one set of code which would be like this:
If CheckBox1.Value = False Then
Sheets("Best").Columns("A:A").Hidden = False
Else
Sheets("Best").Columns("A:A").Hidden = True
End If
If CheckBox2.Value = False Then
Sheets("Best").Columns("B:B").Hidden = False
Else
Sheets("Best").Columns("B;B").Hidden = True
End If
etc...
Anyway to get this done?
Second, related question, providing I can get that done. Is it possible to add a checkbox and have the code say to check certain boxes?
Maybe like this:
If Checkbox10.value=false then
checkbox1.value=false
checkbox2.value=false
checkbox3.value=false
else
checkbox1.value=true
checkbox2.value=true
checkbox3.value=true
Sorry if I've asked this in a confusing way. Ask any questions you may have and thanks in advance for your help!
I have a workbook that has a sheet with a lot of columns. I also have a sheet before it which I want to put checkboxes on which will toggle columns on the second sheet hidden/unhidden.
I'm using an active X control checkbox form, but I can't figure out how to add multiple checkboxes. Is it possible? Or do I have to just create multiple individual checkboxes?
Here is the code that I'm using in the active X control:
If CheckBox1.Value = False Then
Sheets("Best").Columns("A:A").Hidden = False
Else
Sheets("Best").Columns("A:A").Hidden = True
End If
So is the only way to do this to create a lot of individual checkboxes each with this code? I was hoping I might be able to create a checkbox form that has maybe 20 checkboxes and then have them all reference one set of code which would be like this:
If CheckBox1.Value = False Then
Sheets("Best").Columns("A:A").Hidden = False
Else
Sheets("Best").Columns("A:A").Hidden = True
End If
If CheckBox2.Value = False Then
Sheets("Best").Columns("B:B").Hidden = False
Else
Sheets("Best").Columns("B;B").Hidden = True
End If
etc...
Anyway to get this done?
Second, related question, providing I can get that done. Is it possible to add a checkbox and have the code say to check certain boxes?
Maybe like this:
If Checkbox10.value=false then
checkbox1.value=false
checkbox2.value=false
checkbox3.value=false
else
checkbox1.value=true
checkbox2.value=true
checkbox3.value=true
Sorry if I've asked this in a confusing way. Ask any questions you may have and thanks in advance for your help!