Referencing Checkbox Name

C

Chad

I was wondering how I could reference the name of a checkbox and assign it to
the value of a cell.

To give an example of what I am looking for:

I have 5 checkboxes on a sheet and the names of these checkboxes will
eventually change. I would like call A1 to return the name of check box 1,
cell A2 to return the name of check box 2, and so on.

Any help would be greatly appreciated.

Thanks!

Chad
 
O

Office_Novice

Try this...

Sub Do_Cool_Stuff()
Dim CheckBoxes
CheckBoxes = Array(CheckBox1.Name, CheckBox2.Name, _
CheckBox3.Name, CheckBox4.Name, CheckBox5.Name)

Range("A1").Value = CheckBoxes(0)
Range("A2").Value = CheckBoxes(1)
Range("A3").Value = CheckBoxes(2)
Range("A4").Value = CheckBoxes(3)
Range("A5").Value = CheckBoxes(4)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top