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

Hi

Does anyone know how to change the text on a command
button? The following does not work:

ActiveSheet.Shapes("CommandButton1").Caption = "test"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Change CommandButton Caption

Claude,

Try the following:

ActiveSheet.Buttons("Button 1").Caption = "test"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Claude" wrote in message
...
Hi

Does anyone know how to change the text on a command
button? The following does not work:

ActiveSheet.Shapes("CommandButton1").Caption = "test"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change CommandButton Caption

ActiveSheet.OleObjects.("CommandButton1").Object.C aption = "test"

--
Regards,
Tom Ogilvy

"Claude" wrote in message
...
Hi

Does anyone know how to change the text on a command
button? The following does not work:

ActiveSheet.Shapes("CommandButton1").Caption = "test"



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Change CommandButton Caption

"Claude" wrote in message ...
Hi

Does anyone know how to change the text on a command
button? The following does not work:

ActiveSheet.Shapes("CommandButton1").Caption = "test"


Try this:

ActiveSheet.CommandButton1.Caption = "test"
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Change CommandButton Caption

Hi Lisa

This one worked! Thanks

-----Original Message-----
"Claude" wrote in

message ...
Hi

Does anyone know how to change the text on a command
button? The following does not work:

ActiveSheet.Shapes("CommandButton1").Caption = "test"


Try this:

ActiveSheet.CommandButton1.Caption = "test"
.

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 of a button Dylan @ UAFC[_2_] Excel Worksheet Functions 3 November 25th 08 07:04 PM
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
VBA to change excel caption picture ironmouse Excel Programming 0 May 4th 04 09:08 AM
CommandButton.Caption Bob Phillips[_5_] Excel Programming 0 September 8th 03 08:15 AM


All times are GMT +1. The time now is 01:42 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"