Excel VBA: how do I change a button's caption?

  madwab 11:12 31 Dec 2004
Locked

I'd like to change the properties of various objects on the fly, starting with the caption on a button. As usual the help files don't, but they seem to imply that

CommandButton1.Caption=x, or
x=CommandButton1.Caption

...should work for a button named CommandButton1. They don't, so (for example)

Sub Macro1()
Dim c
c = CommandButton1.Caption
End Sub

...gives run time error 424, object required.

What should I be using?

Thanks

  madwab 11:23 31 Dec 2004

Sheets("Sheet1").CommandButton1.Caption=x!

  JaßîsFaß ˜ 11:31 31 Dec 2004

Is this a new gam? Ask a question first, and then see if you can personally beat the other forum members to providing the answer?

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

WPA2 hack: How secure is your Wi-Fi?

HP’s new Surface Pro rival is designed specifically for Adobe-using designers and artists

Best kids apps for iPhone & iPad

Que faire si son iPhone ou iPad est tombé dans de l'eau ?