-
Hi,
Does anyone know how I can create an array of command buttons and then write code so that when a button is pressed an index value or some parameter is passed back to the procedure so that I know which button is pressed. I know it is a simple problem its just my head isn't functioning this morning !!
Thanks for any help
Steve
-
As you say it, iIt's simple.
1 - create a command buton
2 - rename it as you want
3 - copy it
4 - paste it
5 - answer yes at the question to make a control array
All the event associate with the button have now a paramater Index.
-
DOH !!! Thanks for that, Its just come back to me....
Cheers
-
Sorry, I require more info...
I totally agree using VB, but I am trying to create an array in VB running behind Excel. Unfortunately you can't just change the names to the same in VBA.
So my question is again... How do I "create" IN CODE an array to hold command buttons (I am not sure whether to define a control or object) which I can then write code such as
If my array is called Card_buttons
Private Sub Card_buttons_click(Index as Integer)
Sheet(Index).select
(or something similar)
End sub