ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Moving cursor to A1 after save function (https://www.excelbanter.com/excel-discussion-misc-queries/126628-moving-cursor-a1-after-save-function.html)

Steve

Moving cursor to A1 after save function
 
I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?

JE McGimpsey

Moving cursor to A1 after save function
 
Does it have to be *after* the save, or can it be immediately before?

If the latter, put this in the ThisWorkbook code module:

Private Sub Workbook_BeforeSave( _
ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Application.Goto _
Reference:=ActiveSheet.Range("A1"), _
Scroll:=True
End Sub


In article ,
Steve wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?


Bob Phillips

Moving cursor to A1 after save function
 
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
ActiveSheet.Range("A1").Select
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Steve" wrote in message
...
I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a
command
within Excel?




Gary''s Student

Moving cursor to A1 after save function
 
Put this tiny macro in ThisWorkbook code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("A1").Select
End Sub

If you are unfamiliar with VBA, See:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Gary's Student
gsnu200701


"Steve" wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?


Teethless mama

Moving cursor to A1 after save function
 
ctrl+Home

"Steve" wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?


Jim Rech

Moving cursor to A1 after save function
 
Or program the home key to take them to the first cell.

How about Ctrl-Home?

--
Jim
"Steve" wrote in message
...
|I am trying to get the cursor to go to the first cell after a person saves.
| Or program the home key to take them to the first cell. Is there a
command
| within Excel?



Dave Peterson

Moving cursor to A1 after save function
 
Won't this be irritating to users who are editing cell x9999 and hit the Save
icon?

If you want A1 selected when the workbook opens, you may want to select A1 when
the workbook opens--not when it was saved.

Option Explicit
sub auto_Open()
dim wks as worksheet
for each wks in thisworkbook.worksheets
application.goto wks.range("a1"),scroll:=true
next wks
'change this to start at the worksheet you want
thisworkbook.worksheets("sheet99999").select
end sub

just a thought.


Steve wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?


--

Dave Peterson

Steve

Moving cursor to A1 after save function
 
Thanks to all. After reading through these response, what I am really trying
to do is have a person who opens the file automatically be taken to the first
worksheet upon opening and all subsequent worksheet would be back to cell A1.
Many times people hit the save button in a cell that is far from the
beginning and when the next person comes in, they have to manually get to the
top. I want to alleviate this problem. Your thoughts?

"Dave Peterson" wrote:

Won't this be irritating to users who are editing cell x9999 and hit the Save
icon?

If you want A1 selected when the workbook opens, you may want to select A1 when
the workbook opens--not when it was saved.

Option Explicit
sub auto_Open()
dim wks as worksheet
for each wks in thisworkbook.worksheets
application.goto wks.range("a1"),scroll:=true
next wks
'change this to start at the worksheet you want
thisworkbook.worksheets("sheet99999").select
end sub

just a thought.


Steve wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?


--

Dave Peterson


Steve

Moving cursor to A1 after save function
 
Thanks to all. After reading through these response, what I am really trying
to do is have a person who opens the file automatically be taken to the first
worksheet upon opening and all subsequent worksheet would be back to cell A1.
Many times people hit the save button in a cell that is far from the
beginning and when the next person comes in, they have to manually get to the
top. I want to alleviate this problem. Your thoughts?


"Steve" wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?


Steve

Moving cursor to A1 after save function
 
Thanks to all. After reading through these response, what I am really trying
to do is have a person who opens the file automatically be taken to the first
worksheet upon opening and all subsequent worksheet would be back to cell A1.
Many times people hit the save button in a cell that is far from the
beginning and when the next person comes in, they have to manually get to the
top. I want to alleviate this problem. Your thoughts?


"Jim Rech" wrote:

Or program the home key to take them to the first cell.


How about Ctrl-Home?

--
Jim
"Steve" wrote in message
...
|I am trying to get the cursor to go to the first cell after a person saves.
| Or program the home key to take them to the first cell. Is there a
command
| within Excel?




Dave Peterson

Moving cursor to A1 after save function
 
Just what I wrote earlier.

Didn't that help?

Steve wrote:

Thanks to all. After reading through these response, what I am really trying
to do is have a person who opens the file automatically be taken to the first
worksheet upon opening and all subsequent worksheet would be back to cell A1.
Many times people hit the save button in a cell that is far from the
beginning and when the next person comes in, they have to manually get to the
top. I want to alleviate this problem. Your thoughts?

"Dave Peterson" wrote:

Won't this be irritating to users who are editing cell x9999 and hit the Save
icon?

If you want A1 selected when the workbook opens, you may want to select A1 when
the workbook opens--not when it was saved.

Option Explicit
sub auto_Open()
dim wks as worksheet
for each wks in thisworkbook.worksheets
application.goto wks.range("a1"),scroll:=true
next wks
'change this to start at the worksheet you want
thisworkbook.worksheets("sheet99999").select
end sub

just a thought.


Steve wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?


--

Dave Peterson


--

Dave Peterson

Steve

Moving cursor to A1 after save function
 
Dave,

I am not a macro guy. If I create a macro, when would it run and would it
run automatically?

"Dave Peterson" wrote:

Just what I wrote earlier.

Didn't that help?

Steve wrote:

Thanks to all. After reading through these response, what I am really trying
to do is have a person who opens the file automatically be taken to the first
worksheet upon opening and all subsequent worksheet would be back to cell A1.
Many times people hit the save button in a cell that is far from the
beginning and when the next person comes in, they have to manually get to the
top. I want to alleviate this problem. Your thoughts?

"Dave Peterson" wrote:

Won't this be irritating to users who are editing cell x9999 and hit the Save
icon?

If you want A1 selected when the workbook opens, you may want to select A1 when
the workbook opens--not when it was saved.

Option Explicit
sub auto_Open()
dim wks as worksheet
for each wks in thisworkbook.worksheets
application.goto wks.range("a1"),scroll:=true
next wks
'change this to start at the worksheet you want
thisworkbook.worksheets("sheet99999").select
end sub

just a thought.


Steve wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?

--

Dave Peterson


--

Dave Peterson


Dave Peterson

Moving cursor to A1 after save function
 
Put the routine in a General module--not behind a worksheet and not behind
ThisWorkbook.

By naming the routine Auto_Open, it'll run each time the workbook is opened--if
the user allows macros to run.

Since you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

ps. Make sure you change that line to have a worksheet name that exists in your
workbook.

Steve wrote:

Dave,

I am not a macro guy. If I create a macro, when would it run and would it
run automatically?

"Dave Peterson" wrote:

Just what I wrote earlier.

Didn't that help?

Steve wrote:

Thanks to all. After reading through these response, what I am really trying
to do is have a person who opens the file automatically be taken to the first
worksheet upon opening and all subsequent worksheet would be back to cell A1.
Many times people hit the save button in a cell that is far from the
beginning and when the next person comes in, they have to manually get to the
top. I want to alleviate this problem. Your thoughts?

"Dave Peterson" wrote:

Won't this be irritating to users who are editing cell x9999 and hit the Save
icon?

If you want A1 selected when the workbook opens, you may want to select A1 when
the workbook opens--not when it was saved.

Option Explicit
sub auto_Open()
dim wks as worksheet
for each wks in thisworkbook.worksheets
application.goto wks.range("a1"),scroll:=true
next wks
'change this to start at the worksheet you want
thisworkbook.worksheets("sheet99999").select
end sub

just a thought.


Steve wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

Steve

Moving cursor to A1 after save function
 
Dave,

While I was waiting for your response, I copied your code into a new macro
within the workbook and saved it. I also renamed the last command to
recognize a worksheet name. It works like a charm. Thanks a bunch.

"Dave Peterson" wrote:

Put the routine in a General module--not behind a worksheet and not behind
ThisWorkbook.

By naming the routine Auto_Open, it'll run each time the workbook is opened--if
the user allows macros to run.

Since you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

ps. Make sure you change that line to have a worksheet name that exists in your
workbook.

Steve wrote:

Dave,

I am not a macro guy. If I create a macro, when would it run and would it
run automatically?

"Dave Peterson" wrote:

Just what I wrote earlier.

Didn't that help?

Steve wrote:

Thanks to all. After reading through these response, what I am really trying
to do is have a person who opens the file automatically be taken to the first
worksheet upon opening and all subsequent worksheet would be back to cell A1.
Many times people hit the save button in a cell that is far from the
beginning and when the next person comes in, they have to manually get to the
top. I want to alleviate this problem. Your thoughts?

"Dave Peterson" wrote:

Won't this be irritating to users who are editing cell x9999 and hit the Save
icon?

If you want A1 selected when the workbook opens, you may want to select A1 when
the workbook opens--not when it was saved.

Option Explicit
sub auto_Open()
dim wks as worksheet
for each wks in thisworkbook.worksheets
application.goto wks.range("a1"),scroll:=true
next wks
'change this to start at the worksheet you want
thisworkbook.worksheets("sheet99999").select
end sub

just a thought.


Steve wrote:

I am trying to get the cursor to go to the first cell after a person saves.
Or program the home key to take them to the first cell. Is there a command
within Excel?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson



All times are GMT +1. The time now is 08:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com