I've inserted a Command Button (activeX control) to a worksheet. I want to modify its caption using vba code. How do I determine the name property of the button so that I can refer to it in the code?
I've inserted a Command Button (activeX control) to a worksheet. I want to modify its caption using vba code. How do I determine the name property of the button so that I can refer to it in the code?
Please Login or Register to view this content.
e/ In design mode, if you right click the button and go to properties it will show you the button's name.
Last edited by Solus Rankin; 04-03-2014 at 03:43 PM.
Thanks,
Solus
Please remember the following:
1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.Highlight the code in your post and press the # button in the toolbar.2. Show appreciation to those who have helped you by clicking below their posts.
3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.
"Slow is smooth, smooth is fast."
Thanks! What about the same question, except wanting to use vba code to modify the caption of a Button (Form Control)?
The name of the button can be found in the name box (to the left of the formula bar) when the button is selected.Please Login or Register to view this content.
Thanks again!
I changed the Sheets("Sheet1") to ActiveSheet and it worked. When I tried it exactly as recommended, I got an error...
Run-time error '9':Don't know why I got the error since the button is on Sheet1 - but oh well. It works now!
Subscript out of range
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks