Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Duncan Help
 
Posts: n/a
Default Run a macro when opening a spreadsheet

How or where do I invoke a macro when I open a spreadsheet.
  #2   Report Post  
dlw
 
Posts: n/a
Default

name it autoexec
  #3   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi Duncan,

In the workbook's ThisWorkbook Module, insert a

Sub workbook_open()
'Your code
End Sub

macro. To access this module, right-click the Excel icon to the left of
"File" on th menu bar, select "View Code".

Alternatively, in a general module, insert a

Sub Auto_Open
'Your Code
End Sub

macro.

If you are unfamiliar with macros, see David McRitchie's Getting Started
with Macros and User Defined Functions notes at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


---
Regards,
Norman



"Duncan Help" wrote in message
...
How or where do I invoke a macro when I open a spreadsheet.



  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default


"Norman Jones" wrote in message
...
To access this module, right-click the Excel icon to the left of
"File" on th menu bar, select "View Code".


This is true if you have your spreadsheet maximized, but if you don't as in
my case, the icon is at the top-left of the spreadsheet, not by the File
menu.


  #5   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi Bob,

Thank you - I will expand the instructions in future!


---
Regards,
Norman



"Bob Phillips" wrote in message
...

"Norman Jones" wrote in message
...
To access this module, right-click the Excel icon to the left of
"File" on th menu bar, select "View Code".


This is true if you have your spreadsheet maximized, but if you don't as
in
my case, the icon is at the top-left of the spreadsheet, not by the File
menu.






  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

Been there Norman. I think it was Gord Dibben that corrected me :-)

Bob


"Norman Jones" wrote in message
...
Hi Bob,

Thank you - I will expand the instructions in future!


---
Regards,
Norman



"Bob Phillips" wrote in message
...

"Norman Jones" wrote in message
...
To access this module, right-click the Excel icon to the left of
"File" on th menu bar, select "View Code".


This is true if you have your spreadsheet maximized, but if you don't as
in
my case, the icon is at the top-left of the spreadsheet, not by the File
menu.






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
Record Macro Relative does not work? lbbss Excel Discussion (Misc queries) 3 December 13th 04 08:43 PM
Record Macro Relative does not work? lbbss Excel Discussion (Misc queries) 1 December 13th 04 07:55 PM
How do i print out my spreadsheet with macro buttons? Chris.... Excel Discussion (Misc queries) 1 December 12th 04 07:29 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Slow opening files - possible cause and solutoin Bob Flanagan Excel Discussion (Misc queries) 0 November 29th 04 10:04 PM


All times are GMT +1. The time now is 03:19 AM.

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"