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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Macros Auto-execute

Status
Not open for further replies.

madhusd

IS-IT--Management
Aug 13, 2001
74
I created a VB Macro in Excel. Any ideas how to make this run automatically everytime an excel spreadsheet is opened ?? Any help will be greatly appreciated. I created the macro in Office xp.
 
Put a Sub names Auto_Open in the workbook, and call the macro you want to run from that Sub:

Sub Auto_Open()
MyMacro()
End Sub

The Auto_Open sub runs when the workbook opens.

I hope this helps. Good Luck.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Take a look at the Worksheet_Activate() and the Workbook_Open() events.

If you choose to battle wits with the witless be prepared to lose.

[cheers]
 
Sorry, this is a VB.net macro. Not an excel macro. The solution suggested by jebonson did not help ! Any other suggestions ?
 
This is the VB6 forum not the VB.Net forum - check out foada's suggestion


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top