Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

How can I Load my macros automatically, whenever an(any) Excel Open?

  Asked By: Daisy    Date: Jan 06    Category: MS Office    Views: 1068
  

I am very new to Excel VBA. But I know how to write simple macros.

I have a small doubt in VBA. Please clarify

How can I Load my macros automatically, whenever an(any) Excel Open?

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Lula Woods     Answered On: Jan 06

If you save your macros  to Personal.xls they will be available whenever
Excel is open.

 
Answer #2    Answered By: Fayina Bonkob     Answered On: Jan 06

Personal.xls is located in the XLStart directory, and is used to store
macros and
things that you want to be available to all workbooks, whenever you
start
Excel.

By default, it is hidden in Excel, but if you go to the VBE, you use it
as you can
with any other open  workbook (you don't have to unhide it).

You can create it by
- goto Tools>Macros>Record New Macro...
- Choose Personal Macro Workbook form the dropdown
- OK
- click the Stop button on the toolbar that pops-up

You now have a Personal.xls workbook. It is not visible though, it is
hidden
by default (Windows>Unhide)

 
Answer #3    Answered By: Fabian Ferrrari     Answered On: Jan 06

There are two ways.
One is in the VBA editor under ThisWorkbook,
create:
Private Sub Workbook_Open( )
End Sub

The other is on one of the code Modules.
Create:

Sub Auto_Open()
End Sub

Either will work.

 




Tagged: