PC Review


Reply
Thread Tools Rate Thread

Cycle through all Checkboxes on a worksheet

 
 
=?Utf-8?B?dGhlMDBzbm9vcHk=?=
Guest
Posts: n/a
 
      31st Jul 2007
I would like to create a macro that will find all the checkbox controls (they
are all directX) on a worksheet and then check each one. If it is checked, I
would like it to run a macro with a name identical to the caption on the
checkbox.

How would I go about searching for checkboxes and compsosing a list of them?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      31st Jul 2007
Something like this perhaps...
Sub FindCheckboxes()
Dim obj As OLEObject

For Each obj In OLEObjects
If TypeOf obj.Object Is msforms.CheckBox Then
If obj.Object.Value = True Then Application.Run obj.Object.Caption
End If
Next obj
End Sub
--
HTH...

Jim Thomlinson


"the00snoopy" wrote:

> I would like to create a macro that will find all the checkbox controls (they
> are all directX) on a worksheet and then check each one. If it is checked, I
> would like it to run a macro with a name identical to the caption on the
> checkbox.
>
> How would I go about searching for checkboxes and compsosing a list of them?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
please help! worksheet cycle macro John S. Microsoft Excel Discussion 1 18th Sep 2010 07:01 PM
Looping Checkboxes in Worksheet Lin Microsoft Excel Programming 3 12th Nov 2008 09:44 PM
cycle through checkboxes Ryan Ragno Microsoft Excel Programming 1 23rd Jun 2008 09:02 AM
Generalising macro 2 cycle thru checkboxes in frames/pages on User =?Utf-8?B?TEZORmFu?= Microsoft Excel Programming 0 7th Mar 2005 03:43 PM
Cycle through checkboxes =?Utf-8?B?WnNvbHQ=?= Microsoft Excel Programming 6 25th Mar 2004 12:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:18 AM.