Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I execute my VBA program in Excel?

Status
Not open for further replies.

mpadgett

IS-IT--Management
Jun 24, 2005
57
0
0
US
I'm new to VBA. I have taken a Visual Basic program that I wrote a few years ago, re-tooled it a bit and have created a VBA app to run in Excel. It runs perfectly from the VBA editor. I can't figure out how to execute it from a a worksheet.

Thanks,

Mike P.
 


Hi,

Tools/Macro/Marcos - select the macro.

Or add a FORM button to your sheet and assign the macro to the button.


Skip,
[sub]
[glasses] [red]Be Advised![/red]
A wee deranged psychic may be runnin' around out there!
SMALL MEDUIM @ LARGE[tongue][/sub]
 
In addition to running it from the macro menu or a command button, depending on your needs/situation you can:

1. Assign the macro to a toolbar button
2. Make the code run in reponse to an event, such as worksheet inactivation, on update of a certain cell, etc.
3. Assign a shortcut key combination for fast or repetitive execution

Hope this helps.
 
But if your program is entirely within a VBA user form you cannot do any of those things.

You would need to write a small macro that loads and shows the form, and assign that macro to a toolbar, menu item, event, shortcut key, etc.
 
In other words, there are a number of ways to start your code. What do you want to happen, or rather, when?

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top