View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
baconcow baconcow is offline
external usenet poster
 
Posts: 45
Default Checkboxes and Arrays

When working with Check Boxes, is it not possible to use arrays to keep track
of them, as with worksheets?

SET UP

Dim all_boxes As Variant

' setting up ranges
Set range_create = Worksheets("INTRO").Range("F7")


What I am trying to do:

' create array listing the names of every possible sheet (there are MANY
more sheets than listed here)
all_boxes = Array("create_111", "create_112", "create_113")

' select all other check boxes by making them true
For offset_var = 0 To 2 (there are normally 27 check boxes)
Worksheets("INTRO").Array(all_boxes(offset_var)).V alue = True
Next offset_var


What works:

Worksheets("INTRO").create_111 = True
Worksheets("INTRO").create_112 = True
Worksheets("INTRO").create_113 = True

' etc... this takes up a LOT of space, and I always like trying to make more
efficient code, if possible


Problem:

"Object doesn't support this property or method"


Attempts to fix it:

- I have tried putting the names in the array without "" (quotation marks)

- I have tried removing the Array
Worksheets("INTRO").(all_boxes(offset_var)).Value

- I have tried without the Value
Worksheets("INTRO").(all_boxes(offset_var))

- I have tried using Shapes with and without Value
Worksheets("INTRO").Shapes(all_boxes(offset_var))
Worksheets("INTRO").Shapes(all_boxes(offset_var)). Value


It is problem something extremely simple...

Thanks for any help!