VBA - How to change the button text

This worked for me

Worksheets("Sheet1").Button9.TextFrame.Characters.Text = "Loading"


You should try using an Active X button and add this code to that active X button click event. Also, put this code in the same worksheet where this active X button is.:

I am assuming your button starting text is "Original Text". You can replace it with your own text in the code. Also, I am adding 5 seconds delay just to mimic that something is loading. you can replace that part with your code. Also note that in my case active X button name is CommandButton21, in your case it may be different. Update your code accordingly.

Private Sub CommandButton21_Click()
CommandButton21.Caption = "Loading"
Application.Wait (Now + TimeValue("0:00:05"))
CommandButton21.Caption = "Original Text"
End Sub

Go via the Buttons collection:

Worksheets("Sheet1").Buttons("Button9").Text = "Loading"

Tags:

Excel

Vba

Button