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

  madwab 11:12 31 Dec 04
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 04

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

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

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.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

This abstract video touches on division in our technologic world

Best alternatives to iTunes for Mac | Best music players for macOS: Free your music from the…