I have found these other questions here and here which were a little too advanced. I just need a simple way to change the caption of an ActiveX command button "CommandButton1" when running a VBA code. I'm pretty sure it can be done way simpler than the other examples?
Asked
Active
Viewed 934 times
2 Answers
1
I don't think it can get much simpler than this:
Sub test()
Dim sht As Worksheet
Set sht = ThisWorkbook.Worksheets("Name of your Worksheet") 'the worksheet in which the button is located
sht.OLEObjects("Name of your Command Button").Object.Caption = "test"
End Sub

Stavros Jon
- 1,695
- 2
- 7
- 17