Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Cycle through all Checkboxes on a worksheet

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Cycle through all Checkboxes on a worksheet

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
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 keep result from 1 iteration cycle to use in next cycle? sgl8akm Excel Discussion (Misc queries) 0 July 27th 06 08:28 PM
Looping Checkboxes on Worksheet Robbyn Excel Programming 2 August 7th 05 09:09 PM
Generalising macro 2 cycle thru checkboxes in frames/pages on User LFNFan Excel Programming 0 March 7th 05 03:43 PM
Checkboxes on a Shared Worksheet! gr8guy Excel Programming 0 May 6th 04 06:20 AM
Looping checkboxes embedded in worksheet Theresa[_5_] Excel Programming 1 February 27th 04 04:41 AM


All times are GMT +1. The time now is 04:36 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"