SQUIDD
Well-known Member
- Joined
- Jan 2, 2009
- Messages
- 2,144
- Office Version
- 2019
- 2016
- Platform
- Windows
Hi
So lets say i just created 50 command buttons, and let the command button names stay default generated.
But i change all of the captions to words.
Like below,
commandbutton1 caption set to CAT
commandbutton10 caption set to DOG
commandbutton5caption set to RAT
What im trying to get is if i click commandbutton1, a messgae box "CAT"
I know i can write msgbox commandbutton1.caption but i dont want to write out ll the commandbuttons, i want activebutton.caption
So i want the activecontrol caption. But i do not want to hard code each button, i just want 1 code fits all copy and paste.
so if i click commandbutton3000 and this had a caption set to HELLO, msgbox "HELLO"
Really has me stumped
thanks for looking
Dave
So lets say i just created 50 command buttons, and let the command button names stay default generated.
But i change all of the captions to words.
Like below,
commandbutton1 caption set to CAT
commandbutton10 caption set to DOG
commandbutton5caption set to RAT
What im trying to get is if i click commandbutton1, a messgae box "CAT"
I know i can write msgbox commandbutton1.caption but i dont want to write out ll the commandbuttons, i want activebutton.caption
So i want the activecontrol caption. But i do not want to hard code each button, i just want 1 code fits all copy and paste.
so if i click commandbutton3000 and this had a caption set to HELLO, msgbox "HELLO"
Really has me stumped
thanks for looking
Dave