Running macro on file open

  • Thread starter Thread starter excelnerd
  • Start date Start date
E

excelnerd

When I open a particular excel file, I want to always have the cursor on a
specific worksheet. That is, I want the file to open in a particular
worksheet. How can I do that?

Many thanks in advance.
 
You could use a macro:

Option Explicit
Sub Auto_Open()
application.goto thisworkbook.worksheets("sheet9999").range("a1"), _
scroll:=true
End Sub

Change the sheet name and cell address to what you want.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Private sub workbook_open()
application.goto sheets("Sheet1").range("a1")
exit sub

placed in the workbook module, Right-click the Excel icon by the file menu
and choose View code.

Peter
 

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

Back
Top