Go to cell #

  • Thread starter Thread starter Scientific
  • Start date Start date
S

Scientific

Hello all,

Is there a way to force a worksheet to always open in cell A1 regardless of
what cell was active when the worksheet was saved. Sometimes different
people save this worksheet with the cursor resting in different places, so
it's annoying when it opens in some odd blank area. Any help on this is
greatly appreciated.

Thanks,

-S
 
Hi,

You need to write a macro basically

Private Sub Workbook_Open()
Sheets("Sheet1").Activate
Range("A1")
End Sub

This needs to be put in the ThisWorkbook object of the VBA Editor for your
file.

If this helps, please click the Yes buttonl.

Cheers,
Shane
 
Shane,

I added your code to the VBA "ThisWorkbook" object but I get an error
message that says:

Compile error: Invalid use of property

Unfortunately, I don't know how to fix it :-(

-S
 
Shane,

Oops, had a typo in the code but it works great now. Thanks a million Shane.

-S
 
You can use a macro (assuming that users will allow macros to run).

This goes in a General module--not behind ThisWorkbook and not behind a
worksheet.

Option Explicit
Sub Auto_Open()

application.goto thisworkbook.worksheets("Sheet1").range("a1"), scroll:=true

End sub

Change the name of the sheet to what you want.
 
I'm sure that you meant:

Private Sub Workbook_Open()
Sheets("Sheet1").Activate
Range("A1").Select '<-- added .select here
End Sub
 
Back
Top