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?
|