Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default how to autorun a macro from personal.xls?

i need the workbook to auto run the macro from personal.xls once i open the
workbok?how can i do that?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default how to autorun a macro from personal.xls?

Open your VBA editor with Alt + f11 and double click "This Workbook". Use:

Private Sub Workbook_Open()
MyMacro 'The name of your macro
End Sub

The open event will initiate your macro.



"violet" wrote:

i need the workbook to auto run the macro from personal.xls once i open the
workbok?how can i do that?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default how to autorun a macro from personal.xls?

but my macro is store in personal.xsl. so what the code to call that macro.i
only know how to call macro that is store in that workbook but not on another
workbook.

"JLGWhiz" wrote:

Open your VBA editor with Alt + f11 and double click "This Workbook". Use:

Private Sub Workbook_Open()
MyMacro 'The name of your macro
End Sub

The open event will initiate your macro.



"violet" wrote:

i need the workbook to auto run the macro from personal.xls once i open the
workbok?how can i do that?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default how to autorun a macro from personal.xls?

I suppose the simplest way would be to copy the macro from personal.xls to
the other workbook and then use the Workbook_Open method to run the macro.
If your macro is in the code module, you open the module with Alt+f11 while
you have both workbooks open. In the project window on the left of the
screen you can select the code module for Personal.xls to get the code you
want to copy and then scroll to the code module for the other workbook and
paste the code in that workbook code module. Then save the workbooks and the
macro will be available in both workbooks.

If this is confusing to you, you need to get someone in your office who
works with code to help.

"violet" wrote:

but my macro is store in personal.xsl. so what the code to call that macro.i
only know how to call macro that is store in that workbook but not on another
workbook.

"JLGWhiz" wrote:

Open your VBA editor with Alt + f11 and double click "This Workbook". Use:

Private Sub Workbook_Open()
MyMacro 'The name of your macro
End Sub

The open event will initiate your macro.



"violet" wrote:

i need the workbook to auto run the macro from personal.xls once i open the
workbok?how can i do that?

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
autorun a macro Smudge Excel Programming 4 August 11th 06 01:21 PM
Autorun Macro rexmann Excel Discussion (Misc queries) 2 August 2nd 06 02:03 PM
Autorun macro Kelly Excel Worksheet Functions 1 January 18th 06 04:03 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM
Autorun a macro Nigel Chapman Excel Programming 1 February 4th 04 01:02 PM


All times are GMT +1. The time now is 02:39 PM.

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"