I like to put these kinds of things in the workbook_open event. Then each time
I open the workbook, it gets set up the way I like.
Norman used the _BeforeClose routine so that it does it when you're closing the
workbook--but that means you have to worry about whether the workbook should be
saved--maybe the user actually made errors and didn't want to save them.
Anyway, you can't select a sheet if it's hidden. And I'm guessing that you have
a hidden sheet.
This modification of Norman's code worked ok for me. (note the procedure was
changed, too.)
Option Explicit
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
If sh.Visible Then
Application.Goto Reference:=sh.Range("a1"), Scroll:=True
End If
Next sh
Application.ScreenUpdating = True
End Sub