ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   iterating checkboxes (https://www.excelbanter.com/excel-discussion-misc-queries/25734-iterating-checkboxes.html)

[email protected]

iterating checkboxes
 
I've got a few checkboxes in a sheet, "CheckBox1" through "CheckBox3".

I can do this:

c = CheckBox1.Value
etc.

But how would I iterate over them? Like, if I could do this:

c = CheckBox(1).Value

Things like this don't work:

c = ActiveSheet.Shapes("CheckBox1").Value


Dimple Wathen

just found an answer....

For i = 1 to 3
CheckBoxStr = "CheckBox" + CStr(i)
c = ActiveSheet.OLEObjects(CheckBoxStr).Object.value
...
next

how very odd...

--
pls don't email me. i won't read it.



All times are GMT +1. The time now is 04:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com