Tuesday, November 16, 2010

Macro automatically run when opening Excel 2003?

I made a macro that checks a cell with the current date with a cell containing the last date it was opened. If the date it was last opened is less then the current date, it takes everything from the ';current'; row and puts it in the ';previous'; row, then changes the last date it was opened to the current date. It works fine, but to run it I have to use a keyboard shortcut. How can I get it to run the macro automatically every time I open the spreadsheet without having to use the shortcut?Macro automatically run when opening Excel 2003?
Press ALT + F11 to open the VBE



Double click 'This Workbook' in the Microsoft Excel Objects in the upper left quadrant.



In the 'General' drop down menu select 'Workbook'



Enter 'Update' (no quotes) between Private Sub Workbook_Open and End Sub as below:



Private Sub Workbook_Open()

Update

End Sub



Close back to Excel and save the workbook.

No comments:

Post a Comment