ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do I make a simple macro (https://www.excelbanter.com/excel-programming/284909-how-do-i-make-simple-macro.html)

mike

how do I make a simple macro
 
I'd like to create a simple macro that I can give to other
people and that they can load and assign to a button. How
do I do that without creating a project? Or do I have to
create a project? The macro I have in mind consists of
just a few lines I need to automate a couple of processes,
nothing fancy.

mike

Ed[_9_]

how do I make a simple macro
 
The easiest way is just to use the Macro Recorder (ToolsMacroRecord New
Macro). Walk through the steps you want a few times first, just to make
sure you have everything lined out right and you're not going to miss
anything. Then launch the recorder. When the recorder pops up, name the
macro and save it in your Personal.XLS.

After you're done and you close the recorder, you can hit ALT+F11; that
opens the VBA Editor. If it doesn't open to your macro, you can go to
ToolsMacros and select it from the list. If you copy everything from "Sub
[MacroName]()" to "End Sub", you can paste it into any text editor and email
it. I'd also recommend saving it as a separate document - if you wind up
making changes and something goes bad, you can always restore it.

If you run into any snags, let us know. If the code doesn't work, copy it
and paste it into a post back here. Tell us what you were trying to
accomplish and what the macro did/didn't do instead, and most likely someone
here can help.

Good luck!
Ed

"mike" wrote in message
...
I'd like to create a simple macro that I can give to other
people and that they can load and assign to a button. How
do I do that without creating a project? Or do I have to
create a project? The macro I have in mind consists of
just a few lines I need to automate a couple of processes,
nothing fancy.

mike




Tom Ogilvy

how do I make a simple macro
 
Macros are stored in workbooks. You can create it and export it to a bas
file, but to run it, it must be in a workbook.

--
Regards,
Tom Ogilvy

"mike" wrote in message
...
I'd like to create a simple macro that I can give to other
people and that they can load and assign to a button. How
do I do that without creating a project? Or do I have to
create a project? The macro I have in mind consists of
just a few lines I need to automate a couple of processes,
nothing fancy.

mike




Jeff Webb

how do I make a simple macro
 
As far as I know, you'll have to create an Excel Workbook, Template, or Addin to distribute your macro. Using a Template is probably the easiest way.

[email protected]

how do I make a simple macro
 
These two sites have good information on how to create a macro.

David McRitchie
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Tushar Mehta
http://www.tushar-mehta.com/excel/vb...rder/index.htm

If you wish to share your macros, here are a couple of links that
offer solutions.

http://www.google.com/groups?hl=en&l...628a6f4&rnum=6
http://www.google.com/groups?hl=en&l...3622aa&rnum=16
http://www.google.com/groups?hl=en&l...719adb4&rnum=1

I usually transfer by exporting the module that contains the macros
and then importing the module.


HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

I'd like to create a simple macro that I can give to other
people and that they can load and assign to a button. How
do I do that without creating a project? Or do I have to
create a project? The macro I have in mind consists of
just a few lines I need to automate a couple of processes,
nothing fancy.

mike




All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com