automatic macro at opening of excel file

W

Willystu

How do you write a macro to run automatically when opening an excel file? I
find no information in Excel Help, nor several excel/VBA textbooks from
library. This was exceptionally easy to do in Lotus 1-2-3 and seems to me to
be an essential tool.
 
G

Gord Dibben

Willy

You can use in a General Module

Sub Auto_Open()
your code or macroname
End Sub

Or in the ThisWorkbook module.

Sub WorkBook_Open()
your code or macroname
End Sub


Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top