CommandButton Caption change via macro

P

PCLIVE

I've got a command button "CommandButton10" in which the formula line shows
=EMBED("Forms.CommandButton.1",""). I guess that's fairly irrelevant.

The caption on the button is "Week 1". The VBA code is:
--------
Private Sub CommandButton10_Click()
Application.Calculation = xlCalculationManual
Range("AA1").Formula = "1"
Range("AG1").Formula = "1"
Application.Run "CreateWeeks"

End Sub
-----------

Is there some coding that I can include above that will change the caption
on CommandButton10 from "Week 1" to "Week 1 Complete"?

Thanks,
Paul
 
N

Norman Jones

Hi PCLIVE,

Try adding the last line:

If CommandButton10.Caption = "Week 1". Then
CommandButton10.Caption = "Week 1 Complete"
end if
 

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

Top