VBA: Run a macro when Excel starts

August 14th, 2004 | Categories: VBA | Tags: , ,

Do you need to run a macro when Excel starts? Instead of using the Workbook_Open() sub, you can also use the Auto_Open sub.

1. Simply create a subroutine called Auto_Open and place code in it, or call another sub from there. Automatically your code runs when Excel starts.

Private Sub auto_open()
MsgBox "This code ran at Excel start!"
End Sub
No comments yet.