Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Way To Step Through Checkboxes

Folks,

Im hoping this is a simple question and Im just being dense.

I have a user form with around 30 check boxes, to select different
graphs to be displayed or hidden. I am wanting to cycle through the
checkboxes and then for each, if the user has checked the box display
the relevant series on the graphs. So the question is how do I step
from checkbox to checkbox to determine its value.

Thanks for any help,

Andrew
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Simple Way To Step Through Checkboxes

Hi,
Try this,

Dim ctl As Object
For Each ctl In userform1.Controls

'if within userform's codmodule
'For Each ctl In me.Controls

If TypeName(ctl) = "CheckBox" Then
If ctl.Value Then MsgBox ctl.Name & " : marked"
End If
Next


Regards,
Shah Shailesh
http://members.lycos.co.uk/shahweb/


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Way To Step Through Checkboxes

hi,

Thats great.

Thanks for the quick reply.

Andrew

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Simple Way To Step Through Checkboxes

Hi,
Not tested but try this:

Dim myControl As MSForms.Control
For Each myControl In myForm.Controls
If TypeOf myControl Is MSForms.CheckBox Then
'something to do with myControl.Value
End If 'typeof
Next myControl

regards
Paul

(Andrew) wrote in message . com...
Folks,

Im hoping this is a simple question and Im just being dense.

I have a user form with around 30 check boxes, to select different
graphs to be displayed or hidden. I am wanting to cycle through the
checkboxes and then for each, if the user has checked the box display
the relevant series on the graphs. So the question is how do I step
from checkbox to checkbox to determine its value.

Thanks for any help,

Andrew

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Simple Way To Step Through Checkboxes

Well, the Userform object has a Controls collection which you could
loop through and do a TypeOf comparison to test which are CheckBox.
However, you would make things easier on yourself if in the form's
_Activate event you put all the relevant checkboxes into your own
Collection, array or similar, then you'd *know* where to look for them
later.

--

(Andrew) wrote in message . com...
Folks,

Im hoping this is a simple question and Im just being dense.

I have a user form with around 30 check boxes, to select different
graphs to be displayed or hidden. I am wanting to cycle through the
checkboxes and then for each, if the user has checked the box display
the relevant series on the graphs. So the question is how do I step
from checkbox to checkbox to determine its value.

Thanks for any help,

Andrew

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
Need simple step by step help flashy Excel Discussion (Misc queries) 1 August 14th 09 04:50 PM
Creating a Drop Down List with Step by Step Instructions for 2007 remarkable Excel Worksheet Functions 2 March 22nd 09 04:36 AM
Need step by step to add invoice numbering to excel template rmt New Users to Excel 4 July 6th 08 11:45 PM
how do you insert multiple simple checkboxes in an Excel Spreadshe mgreen74 Excel Discussion (Misc queries) 0 March 8th 06 03:19 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM


All times are GMT +1. The time now is 11:34 AM.

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"