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.

Hands-on: Acer Predator Triton 700 review

D&AD Awards 2017: see the best design, advertising, illustration, animation and VR of the past year

How to lose weight with an Apple Watch