Automatic cursor position?

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Is there a way to set the cursor to automatically go to a
specific "home" everytime a specific workbook/worksheet is
open? I would like to have the ability to set the cursor
to always go to one cell whenever the file is open (NOT to
where it was last left when the file was last closed).
 
You can use this in the Thisworkbook module

Right click on the Excel icon next to File in the menubar
choose view code
paste it in there
Alt-Q to go back to Excel


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.Goto Reference:=Worksheets("Sheet1").Range("A1"), _
scroll:=True
End Sub
 
Better use this event instead of the BeforeSave Mark

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Goto Reference:=Worksheets("Sheet1").Range("A1"), _
scroll:=True
End Sub
 
Back
Top