Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default how to apply button text from macro?

Greetings and TIA for your time
Button1 triggers Macro1. Macro1 has code to change the text on Button1
Using a button from the 'forms' toolbar
I've tried:ActiveSheet.Shapes("Button 1").Characters.Text = "NewText" -
which fails.
What code should I use?
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how to apply button text from macro?

ActiveSheet.buttons("Button 1").Caption = "New Text"

--
Regards,
Tom Ogilvy


"David" wrote in message
...
Greetings and TIA for your time
Button1 triggers Macro1. Macro1 has code to change the text on Button1
Using a button from the 'forms' toolbar
I've tried:ActiveSheet.Shapes("Button 1").Characters.Text = "NewText" -
which fails.
What code should I use?
David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default how to apply button text from macro?

Thanks Tom
Much appreciated
--
David
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default how to apply button text from macro?

Will this also work for a CommandButton1? I've tried:

ActiveSheet.Buttons("CommandButton1").Caption = "test"
ActiveSheet.CommandButton("CommandButton1").Captio n = "test"

It's not working this way. What code should I be using?

Thanks,
Paul


"Tom Ogilvy" wrote in message
...
ActiveSheet.buttons("Button 1").Caption = "New Text"

--
Regards,
Tom Ogilvy


"David" wrote in message
...
Greetings and TIA for your time
Button1 triggers Macro1. Macro1 has code to change the text on Button1
Using a button from the 'forms' toolbar
I've tried:ActiveSheet.Shapes("Button 1").Characters.Text = "NewText" -
which fails.
What code should I use?
David





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default how to apply button text from macro?

Got it!

ActiveSheet.CommandButton1.Caption = "test"

Thanks anyway.

"PCLIVE" wrote in message
...
Will this also work for a CommandButton1? I've tried:

ActiveSheet.Buttons("CommandButton1").Caption = "test"
ActiveSheet.CommandButton("CommandButton1").Captio n = "test"

It's not working this way. What code should I be using?

Thanks,
Paul


"Tom Ogilvy" wrote in message
...
ActiveSheet.buttons("Button 1").Caption = "New Text"

--
Regards,
Tom Ogilvy


"David" wrote in message
...
Greetings and TIA for your time
Button1 triggers Macro1. Macro1 has code to change the text on Button1
Using a button from the 'forms' toolbar
I've tried:ActiveSheet.Shapes("Button 1").Characters.Text = "NewText" -
which fails.
What code should I use?
David







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
macro apply to all worksheet AskExcel Excel Worksheet Functions 3 April 1st 09 03:30 PM
Random text via Macro button Markv Excel Discussion (Misc queries) 3 July 10th 08 10:00 AM
Apply macro to one sheet only Marcus Analyst Excel Discussion (Misc queries) 9 January 3rd 08 10:14 PM
Apply a Macro to a FunctionKey... doo[_2_] Excel Programming 1 July 7th 04 05:43 PM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar[_15_] Excel Programming 1 May 26th 04 09:45 AM


All times are GMT +1. The time now is 12:36 AM.

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

About Us

"It's about Microsoft Excel"