PC Review


Reply
Thread Tools Rate Thread

assign macro to button programmatically

 
 
Zone
Guest
Posts: n/a
 
      30th Dec 2007
I have a button on my worksheet from the Forms toolbar. I know I can use
ActiveSheet.Buttons(1).Caption="My Text" to set the button's caption. But
how do I set the button's macro to sub SpeakMsg? Excel XP. Thanks, James


 
Reply With Quote
 
 
 
 
Helmut Weber
Guest
Posts: n/a
 
      30th Dec 2007
Hi Zone

Sub Macro1()
ActiveSheet.Shapes("Button 1").OnAction = "testB"
End Sub


--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
Reply With Quote
 
Zone
Guest
Posts: n/a
 
      31st Dec 2007
Many thanks and regards to Munich

"Helmut Weber" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Zone
>
> Sub Macro1()
> ActiveSheet.Shapes("Button 1").OnAction = "testB"
> End Sub
>
>
> --
>
> Greetings from Bavaria, Germany
>
> Helmut Weber, MVP WordVBA
>
> Vista Small Business, Office XP



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign a macro to a button totofab Microsoft Excel Misc 4 13th Dec 2007 06:16 PM
How do I Assign Macro to a button? =?Utf-8?B?QmVsbEV4Y2Vs?= Microsoft Excel Charting 4 20th May 2005 07:21 PM
Re: Assign macro to button Bob Phillips Microsoft Excel Programming 0 24th May 2004 04:27 PM
Assign button to run macro jamie85 Microsoft Excel Programming 8 3rd Feb 2004 01:44 PM
Assign Macro to button Eric W. Microsoft Outlook VBA Programming 1 15th Jul 2003 06:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.