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.

What is Amazon Go and will it come to the UK? The store without checkouts or queues

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

Why ecommerce hasn't taken off on social media

Super Mario Run preview | Hands-on first impressions of Super Mario Run: Mario's iPhone & iPad…