|
-
March 23rd, 2001, 12:59 PM
#1
VBA - Need to look at Checkboxs on a worksheet
Greetings,
I need to loop through an array of checkboxes placed on a worksheet, not a form. With what I'm trying, I get a error - Object does not support property or method. How do I reference the controls on that worksheet?
Thanks
-
March 25th, 2001, 06:13 PM
#2
Re: VBA - Need to look at Checkboxs on a worksheet
I think you may want to try something like this:
Dim xlSheet as Excel.Worksheet
Dim shp as Excel.Shape
set xlSheet = Worksheets("Sheet1")
for Each shp In xlSheet.Shapes
' If the type is an OLE Control
If shp.Type = msoOLEControlObject then
MsgBox shp.Name
End If
next
You may have to change the type to whatever you are looking for. (I think that type is correct if you are using the Control Toolbox in VB), but I think that should get you going.
Hope this helps,
Nathan.
-
March 28th, 2001, 02:08 PM
#3
Re: VBA - Need to look at Checkboxs on a worksheet
Thanks Nathan, I'll try it. I have, however, reworked my approach to what I'm trying to solve.
Ken
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|