"Open a spreadsheet" is not technically correct.
1. You can open a workbook (.xls file).
To get a macro to run with this event go to VBA Editor. View menu/Project Explorer. Doubleclick ThisWorkbook. Select the Open event from dropdown bo top right which gives a macro outlinr :-
Code:
Private Sub Workbook_Open()
' put code here
End Sub
2. To trap the event of changing from one worksheet to another use the SheetChange event in the same place :-
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
' put code here
End Sub
-----------------------
Regards BrianB
Most problems occur from starting at the wrong place.
Use a cup of coffee to make Windows run faster.
It is easy until you know how.