Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default auto execute

I have a macro that I want to run automatically when the
user opens up the workbook and select enable macro. Does
anybody know how i can do that.

Thanks in Advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default auto execute

In the code for ThisWorkbook:

----

Private Sub Workbook_Open()
'your code here
End Sub

----

HTH
Anders Silven

"jpepper" skrev i meddelandet ...
I have a macro that I want to run automatically when the
user opens up the workbook and select enable macro. Does
anybody know how i can do that.

Thanks in Advance


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default auto execute

Sub Auto_Open()
'WriteYourCodeHere
End Sub

You give the above name to your macro and it will run upon opening the
workbook.
Gabor

"jpepper" schrieb im Newsbeitrag
...
I have a macro that I want to run automatically when the
user opens up the workbook and select enable macro. Does
anybody know how i can do that.

Thanks in Advance




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default auto execute

Go into VBA, Expand "VBAProject (Book1)" tree and you should see a folder
called "Microsoft Excel Objects". Under that you should see "ThisWorkbook".
Double click "ThisWorkbook" to get the code window. In the left drop-down
above the code window, select workbook. The code:
Private Sub Workbook_Open()

End Sub
....should be put in automatically. Now insert the name of the sub that
starts your macro within this new sub.

When you launch XL it should automatically run your macro.

--
______________________________
Thank you, Sean
Artist/Production Manager
Please visit us at www.oatesflag.com
502-267-8200
502-267-8246 fax
"jpepper" wrote in message
...
I have a macro that I want to run automatically when the
user opens up the workbook and select enable macro. Does
anybody know how i can do that.

Thanks in Advance




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Execute Macro dennis[_2_] Excel Discussion (Misc queries) 4 January 17th 09 04:47 PM
Auto Execute Macro dennis[_2_] Excel Worksheet Functions 4 January 17th 09 04:47 PM
Auto execute upon workbook retrieval TOMD Excel Discussion (Misc queries) 0 February 7th 07 08:12 PM
execute auto invoice numbering in excel file tom adeimy Excel Discussion (Misc queries) 1 July 25th 06 02:54 AM
Auto-execute macro.... Eric @ SEASH, Evansville Excel Discussion (Misc queries) 1 August 24th 05 09:32 PM


All times are GMT +1. The time now is 11:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"