PC Review


Reply
Thread Tools Rate Thread

Beginners Allowed?? Macro Question

 
 
RobinH
Guest
Posts: n/a
 
      23rd Nov 2003

Found this website googling help with macros and assigning to a button.
What I'm trying to accomplish is within a worksheet to have severa
control buttons that would run a sort macro. Pretty basic such a
sorting by zip codes, cities, state. I'm guessing that the butto
would be an ActiveX control. I know how to record & name a macro but
can't make it work to assign a macro to an ActiveX button. I was abl
to create a button and name it but assigning a macro to it is mor
complicated and I don't understand the instrux from the Help that
printed out. It looks like it gets into Visual Basic coding. What
read was about starting a macro from a button or graphic control and i
seemed to read that it was as easy as right clicking on the button an
choosing assign macro. That option to assign macro didn't come up.
I'm lost....can someone put me in the right direction. I'm not
programmer (obviously), just trying to improve functionality of
spreadsheet. Thanks for any help that anyone can give!!

Robi

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

 
Reply With Quote
 
 
 
 
A.W.J. Ales
Guest
Posts: n/a
 
      23rd Nov 2003
Robin,

You probably took a button from the Control Toolbar. If you take a
button from the Forms Toolbar itwill give you the opportunity to assign a
macro to it by right clicking on it (if not directly by "dragging" it from
the toolbar to your sheet.


--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"RobinH" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Found this website googling help with macros and assigning to a button.
> What I'm trying to accomplish is within a worksheet to have several
> control buttons that would run a sort macro. Pretty basic such as
> sorting by zip codes, cities, state. I'm guessing that the button
> would be an ActiveX control. I know how to record & name a macro but I
> can't make it work to assign a macro to an ActiveX button. I was able
> to create a button and name it but assigning a macro to it is more
> complicated and I don't understand the instrux from the Help that I
> printed out. It looks like it gets into Visual Basic coding. What I
> read was about starting a macro from a button or graphic control and it
> seemed to read that it was as easy as right clicking on the button and
> choosing assign macro. That option to assign macro didn't come up.
> I'm lost....can someone put me in the right direction. I'm not a
> programmer (obviously), just trying to improve functionality of a
> spreadsheet. Thanks for any help that anyone can give!!
>
> Robin
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>



 
Reply With Quote
 
Harald Staff
Guest
Posts: n/a
 
      23rd Nov 2003
Hi Robin

Adding to Auk's advice (Forms buttons):

ActiveX buttons already have lots of empty macros assigned to them. They are found in the
container's module (which is either the Worksheet module or the Userform module). The most
used macro code is Click:

Private Sub CommandButton1_Click()

End Sub

And you start other macros with it by calling them from this one

Private Sub CommandButton1_Click()
Call Macro1
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"RobinH" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Found this website googling help with macros and assigning to a button.
> What I'm trying to accomplish is within a worksheet to have several
> control buttons that would run a sort macro. Pretty basic such as
> sorting by zip codes, cities, state. I'm guessing that the button
> would be an ActiveX control. I know how to record & name a macro but I
> can't make it work to assign a macro to an ActiveX button. I was able
> to create a button and name it but assigning a macro to it is more
> complicated and I don't understand the instrux from the Help that I
> printed out. It looks like it gets into Visual Basic coding. What I
> read was about starting a macro from a button or graphic control and it
> seemed to read that it was as easy as right clicking on the button and
> choosing assign macro. That option to assign macro didn't come up.
> I'm lost....can someone put me in the right direction. I'm not a
> programmer (obviously), just trying to improve functionality of a
> spreadsheet. Thanks for any help that anyone can give!!
>
> Robin
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>



 
Reply With Quote
 
Earl Kiosterud
Guest
Posts: n/a
 
      23rd Nov 2003
Robin,

ActiveX have all kinds of events, with preassigned macros, as Herald has
mentioned. You can also use just about any graphic (like a shape from the
Drawing Toolbar, a WordArt, or an inserted picture or clip art (Insert -
Picture))and use the right mouse to assign it to your macro. In this case,
your macro would be in a regular module.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"RobinH" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Found this website googling help with macros and assigning to a button.
> What I'm trying to accomplish is within a worksheet to have several
> control buttons that would run a sort macro. Pretty basic such as
> sorting by zip codes, cities, state. I'm guessing that the button
> would be an ActiveX control. I know how to record & name a macro but I
> can't make it work to assign a macro to an ActiveX button. I was able
> to create a button and name it but assigning a macro to it is more
> complicated and I don't understand the instrux from the Help that I
> printed out. It looks like it gets into Visual Basic coding. What I
> read was about starting a macro from a button or graphic control and it
> seemed to read that it was as easy as right clicking on the button and
> choosing assign macro. That option to assign macro didn't come up.
> I'm lost....can someone put me in the right direction. I'm not a
> programmer (obviously), just trying to improve functionality of a
> spreadsheet. Thanks for any help that anyone can give!!
>
> Robin
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>



 
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
Excel Macro for Beginners Positive Microsoft Excel Worksheet Functions 5 20th Aug 2007 07:20 PM
Beginners Question Black_op51 Microsoft Excel Misc 6 8th Nov 2006 11:46 PM
RE: Excel VBA/Macro programming for beginners =?Utf-8?B?U2F2aXo=?= Microsoft Excel New Users 0 6th Sep 2006 06:29 AM
Re: Excel VBA/Macro programming for beginners Gord Dibben Microsoft Excel New Users 3 5th Sep 2006 08:20 AM
beginners question Peter Ramsebner Microsoft Dot NET Compact Framework 2 16th Apr 2006 08:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:06 AM.