cursor position

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Excel 2003, running XP Pro

Is there a way to have the cursor always be placed in a certain cell when a
workbook is opened up - regardless of where the user left it when they exited
out last?

Thanks for your help!

Mark
 
Private Sub Workbook_Open()
Worksheets("Sheet1").Cells(1, 1).Select
End Sub

Modify the sheet and cell as necessary
 
Yes:

The following macro will put the cursor in Z100 whenever the book is opened:

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


must be put in ThisWorkbook code.
 
I entered in your macro as listed and ran it, and it indeed did work. I
saved the workbook and then opened it up again, however, the cursor was not
in the location that I specified in the macro.

Furthermore, when I went to edit the macro, it did not appear in the macro
window??? Not sure what's going on.
 
Mark

The code is to go into Thisworkbook module and is run automatically when the
workbook opens. Perhaps you didn't read that bit?

Copy the code as written then right-click on the Excel logo left of "File" on
the menu bar if window is maximized, on the Excel logo on window title bar if
not maximized.

Select "View Code". Paste the code into that module.

ALT + q to go back to Excel.

Choose another worksheet and cell.

Save/close and re-open to see Sheet1 and Z100 selected.

BTW......the reason it doesn't show in Tools>Macro>Macros if you placed it in a
general module is the "Private" part.


Gord Dibben MS Excel MVP
 
Hi Gord,

Thanks for your post; it worked as you stated.

After working with Excel for ten years I can't believe just how much that I
don't know, and how much I have to learn yet.

Thanks for having the patience with me and others like me in this forum!
 

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