Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I subtract time where hh:mm:ss:ff (frames = 30 frames/sec) KJ7 Excel Discussion (Misc queries) 14 December 3rd 16 10:03 AM
Counting time-frames Ken G. Excel Discussion (Misc queries) 2 August 12th 08 01:11 PM
Freeze /Split frames Thor Excel Worksheet Functions 4 June 10th 08 12:29 AM
Frames in Excel with drop down boxes. Adam Excel Discussion (Misc queries) 2 December 31st 06 04:53 PM
freezing frames Bob Griendling Excel Worksheet Functions 4 July 1st 06 10:58 PM


All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"