If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Autostart Macro when workbook opens

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-22-04, 15:12
qimel qimel is offline
Registered User
 
Join Date: Feb 2004
Location: USA - California
Posts: 21
Autostart Macro when workbook opens

How do you tell a macro module to automatically run when the workbook is opened? I am doing a simple copy/paste special values before they are updated and would like the macro to run this without the user having to click on a macro button to run it everytime they open the workbook.

Thank you,
Melinda
Reply With Quote
  #2 (permalink)  
Old 02-22-04, 16:09
bmacr bmacr is offline
Registered User
 
Join Date: Feb 2004
Location: Canada
Posts: 133
In the Project window of the VBA window, double-click This Workbook.

Add the following:

Private Sub Workbook_Open()
Call Macro1' Or whatever your macro name is
End Sub
Reply With Quote
  #3 (permalink)  
Old 02-22-04, 16:24
qimel qimel is offline
Registered User
 
Join Date: Feb 2004
Location: USA - California
Posts: 21
Fantastic........Thank you!!!!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On