Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Return to original location

Hope someone can help.

I have a wookbook with several sheets in one of which is a list. I want to
be able launch a macro from anywhere in the workbook to add a new record to
the list then return to the cell where i originally launched the macro.

I can add the new record but can't figure out how to get back to my original
cell.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Return to original location

Jim, untested, but should work:

at top of macro:

dim cellToReturnTo as range
set cellToReturnTo = activecell

at the end of the macro:

Application.GoTo cellToReturnTo

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Jim" wrote in message
...
Hope someone can help.

I have a wookbook with several sheets in one of which is a list. I want
to
be able launch a macro from anywhere in the workbook to add a new record
to
the list then return to the cell where i originally launched the macro.

I can add the new record but can't figure out how to get back to my
original
cell.



  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Return to original location

Fantastic, thanks Bob works like a dream

"Bob Flanagan" wrote:

Jim, untested, but should work:

at top of macro:

dim cellToReturnTo as range
set cellToReturnTo = activecell

at the end of the macro:

Application.GoTo cellToReturnTo

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Jim" wrote in message
...
Hope someone can help.

I have a wookbook with several sheets in one of which is a list. I want
to
be able launch a macro from anywhere in the workbook to add a new record
to
the list then return to the cell where i originally launched the macro.

I can add the new record but can't figure out how to get back to my
original
cell.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Going back to original location Té Excel Discussion (Misc queries) 1 August 27th 09 03:06 AM
where is the original data location in a worksheet stored? z.entropic Excel Worksheet Functions 2 December 22nd 07 11:28 PM
How can I copy many formulas and keep original cell location? Linda Oz Excel Discussion (Misc queries) 3 October 5th 06 08:31 AM
Moving Cursor & Sheet back to the Original Location Ricky Pang Excel Programming 2 July 8th 05 04:18 PM
The Template Wizard retains the original location for my database Packwood Excel Discussion (Misc queries) 0 April 15th 05 05:25 PM


All times are GMT +1. The time now is 04:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"