Excel macro

How do you 'kick off' a macro automatically when the excel spreadsheet is opened?
Who is Participating?
bruintjeConnect With a Mentor Commented:
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...

Use a macro called "AutoExec".
Name the macro Auto_Open

pacificdb: AutoExec is for Word macros that you want to run when you first start Word.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.