Wild Ideas

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to change the caption on a command button
(in excel/vba) when a user clicks the button to say
something different.
 
Is it possible to change the caption on a command button
(in excel/vba) when a user clicks the button to say
something different.

Private Sub CommandButton1_Click()
Static lCount As Long
If lCount Mod 2 Then
CommandButton1.Caption = "Click Me Once"
Else
CommandButton1.Caption = "Click Me Again"
End If
lCount = lCount + 1
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top