Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forms and Frames
Hiya
I have a Userform which contains a frame. This frame contains ten or so CheckBoxes. I am looking for a macro or function by which I can make all the boxes checked or unchecked. I was hoping I could reference to the frame's members rather than referring to each checkbox in turn. Is this possible? I would apprecaite any help (even an answer saying its not possible!) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forms and Frames
Add two option buttons to your form and use this code.
Private Sub OptionButton1_Click() Dim CB As Control For Each CB In Frame1.Controls If TypeOf CB Is msforms.CheckBox Then CB = True Else CB = False End If Next CB End Sub Private Sub OptionButton1_Click() Dim CB As Control For Each CB In Frame1.Controls If TypeOf CB Is msforms.CheckBox Then CB = True Else CB = False End If Next CB End Sub Now you can play with that and come up with what you really want. Chrissy. "Shunt" wrote in message ... Hiya I have a Userform which contains a frame. This frame contains ten or so CheckBoxes. I am looking for a macro or function by which I can make all the boxes checked or unchecked. I was hoping I could reference to the frame's members rather than referring to each checkbox in turn. Is this possible? I would apprecaite any help (even an answer saying its not possible!) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forms and Frames
-----Original Message----- Hiya I have a Userform which contains a frame. This frame contains ten or so CheckBoxes. I am looking for a macro or function by which I can make all the boxes checked or unchecked. I was hoping I could reference to the frame's members rather than referring to each checkbox in turn. Is this possible? I would apprecaite any help (even an answer saying its not possible!) . for x=1 to 10 userform1(checkbox & x).value = true next x not sure if checkbox needs to be in "" |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forms and Frames
Hello
This will toggle all Checkboxes in Frame frChecks: Dim ctr As MSForms.CheckBox For Each ctr In Me.frChecks.Controls ctr.Value = Not ctr.Value Next ctr Heiko :-) "Shunt" wrote: Hiya I have a Userform which contains a frame. This frame contains ten or so CheckBoxes. I am looking for a macro or function by which I can make all the boxes checked or unchecked. I was hoping I could reference to the frame's members rather than referring to each checkbox in turn. Is this possible? I would apprecaite any help (even an answer saying its not possible!) |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forms and Frames
But he did not want them to toggle - he wanted them all true
or all false. Chrissy. "Heiko" wrote in message ... Hello This will toggle all Checkboxes in Frame frChecks: Dim ctr As MSForms.CheckBox For Each ctr In Me.frChecks.Controls ctr.Value = Not ctr.Value Next ctr Heiko :-) "Shunt" wrote: Hiya I have a Userform which contains a frame. This frame contains ten or so CheckBoxes. I am looking for a macro or function by which I can make all the boxes checked or unchecked. I was hoping I could reference to the frame's members rather than referring to each checkbox in turn. Is this possible? I would apprecaite any help (even an answer saying its not possible!) |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forms and Frames
Tom Ogilvy wrote
The OP also said: I was hoping I could reference to the frame's members rather than referring to each checkbox in turn. But got all giggly when you showed him/her how to refer "to each checkbox in turn." So he/she might get excited about how to toggle as well. <g So that is your motivation for being so helpful on these newsgroups - to get the readers all excited - ummmm, lets not go there. ;-) Chrissy. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I subtract time where hh:mm:ss:ff (frames = 30 frames/sec) | Excel Discussion (Misc queries) | |||
Counting time-frames | Excel Discussion (Misc queries) | |||
Freeze /Split frames | Excel Worksheet Functions | |||
Frames in Excel with drop down boxes. | Excel Discussion (Misc queries) | |||
freezing frames | Excel Worksheet Functions |