Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default CommandButton Caption change via macro

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default CommandButton Caption change via macro

Try this

Me.CommandButton10.Caption = "Week 1 Complete"



--
Regards Ron de Bruin
http://www.rondebruin.nl


"PCLIVE" wrote in message ...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default CommandButton Caption change via macro

Thanks.

That works great!


"Ron de Bruin" wrote in message
...
Try this

Me.CommandButton10.Caption = "Week 1 Complete"



--
Regards Ron de Bruin
http://www.rondebruin.nl


"PCLIVE" wrote in message

...
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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default CommandButton Caption change via macro

Hi PCLIVE,

Try adding the last line:

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

---
Regards,
Norman



"PCLIVE" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change caption on a macro button gbeard Excel Worksheet Functions 3 April 21st 05 01:43 PM
The font of the caption for the commandbutton is illegible. DarkVader Excel Discussion (Misc queries) 2 November 30th 04 02:45 PM
CommandButton caption title Paul Excel Programming 1 August 5th 04 11:38 PM
Change CommandButton Caption Claude Excel Programming 4 July 16th 04 04:18 PM
CommandButton.Caption Bob Phillips[_5_] Excel Programming 0 September 8th 03 08:15 AM


All times are GMT +1. The time now is 03:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"