ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change a buton "Caption" from VBA (https://www.excelbanter.com/excel-programming/315352-change-buton-caption-vba.html)

0000_AAAA_0000[_5_]

Change a buton "Caption" from VBA
 

Hi!

and Many Thanks in Advance!


If i have a commandBoton; to change his caption
all I have to do is:

Sub AAA()
With ActiveSheet.CommandButton1
.Caption = "NewName"
End With
End Sub



but:

how can I change a Button name when is not a CommandBoton but a Buto
from the form Toolbar

--
0000_AAAA_000
-----------------------------------------------------------------------
0000_AAAA_0000's Profile: http://www.excelforum.com/member.php...fo&userid=1248
View this thread: http://www.excelforum.com/showthread.php?threadid=27406


Ivan F Moala[_35_]

Change a buton "Caption" from VBA
 

ActiveSheet.Shapes("Name of Button").TextFrame.Characters.Text
"Testing 123

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=27406


Tom Ogilvy

Change a buton "Caption" from VBA
 
Assume rather than change the button's name, I assume you mean you want to
change the caption (what is displayed on the button).

Activesheet.buttons("ButtonName").Caption = "ABCD"

would be another way (perhaps more direct).

--
Regards,
Tom Ogilvy

"0000_AAAA_0000" wrote in
message ...

Hi!

and Many Thanks in Advance!


If i have a commandBoton; to change his caption
all I have to do is:

Sub AAA()
With ActiveSheet.CommandButton1
Caption = "NewName"
End With
End Sub



but:

how can I change a Button name when is not a CommandBoton but a Buton
from the form Toolbar?


--
0000_AAAA_0000
------------------------------------------------------------------------
0000_AAAA_0000's Profile:

http://www.excelforum.com/member.php...o&userid=12480
View this thread: http://www.excelforum.com/showthread...hreadid=274065





All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com