Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBA - How to change the button text

Tags:

button

excel

vba

I assigned an Excel VBA macro to a command button, and I am needing to know how to update the text to "Loading" when the macro is executed.

I have tested the following code with no success:

Worksheets("Sheet1").Button9.Caption = "Loading"
like image 805
Belgacem Ksiksi Avatar asked Feb 02 '17 10:02

Belgacem Ksiksi


1 Answers

Go via the Buttons collection:

Worksheets("Sheet1").Buttons("Button9").Text = "Loading"
like image 191
Alex K. Avatar answered Sep 25 '22 08:09

Alex K.