Solved

Excel macro

Posted on 2000-05-06
3
329 Views
Last Modified: 2010-05-02
How do you 'kick off' a macro automatically when the excel spreadsheet is opened?
0
Comment
Question by:ff_axel
3 Comments
 
LVL 3

Expert Comment

by:pacificdb
ID: 2784030
Use a macro called "AutoExec".
0
 

Expert Comment

by:stubbs
ID: 2784330
Name the macro Auto_Open

pacificdb: AutoExec is for Word macros that you want to run when you first start Word.
0
 
LVL 44

Accepted Solution

by:
bruintje earned 40 total points
ID: 2785912
in your Excel workbook

open the Code editor with ALT + F11
then insert this code in the thisworkbook object

Private sub Workbook_Open()
  msgbox "opening1"
end sub

or preferable..insert a new module

and insert this code

sub Auto_open()
  msgbox "opening2"
end sub

both will run on the open, but the first is a bit troublesome when debugging code...

HTH:O)Bruintje
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question