Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to make macro start when file is opened

I want a macro to start running when I open the file, how and where do I use
an event procedure like workbook_open (if this is a real one??) to do this?
Excel2000.

Thanks,

John


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to make macro start when file is opened

John,

You've got it.

Private Sub Workbook_Open()
'your code here
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"gifer" wrote in message
...
I want a macro to start running when I open the file, how and where do I

use
an event procedure like workbook_open (if this is a real one??) to do

this?
Excel2000.

Thanks,

John




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 303
Default How to make macro start when file is opened

Go to VBA editor using <alt + <f11

In the "project - vba project window" double click on "this workbook"
On the right side of the window click on dropdown arrow next to "general"
select "workbook"
click on dropdown next to "open" to see all possible event options
select "open" or any of the others
enter the name of the macro you want to run without the Sub and without the
( )

So it should look like...........

Private Sub Workbook_Open()
macroname
End Sub


Regards
Bill K

"gifer" wrote in message
...
I want a macro to start running when I open the file, how and where do I
use an event procedure like workbook_open (if this is a real one??) to do
this? Excel2000.

Thanks,

John



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
How to run a macro automatically when the file is opened? LunaMoon Excel Discussion (Misc queries) 1 April 24th 10 01:01 AM
How can I start a new excel program for each opened excel file? Amos Setting up and Configuration of Excel 6 April 3rd 09 02:49 PM
How to auto activate macro when file opened bonzio Excel Worksheet Functions 3 December 17th 05 03:19 PM
Set up Excel to start new instance for each new file opened. Minimal_Subset Excel Discussion (Misc queries) 2 May 12th 05 01:36 AM
how to make a macro and run in every excel book that opened? wayan Excel Programming 3 February 22nd 05 08:47 AM


All times are GMT +1. The time now is 07:21 AM.

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

About Us

"It's about Microsoft Excel"