Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Going back to original location | Excel Discussion (Misc queries) | |||
where is the original data location in a worksheet stored? | Excel Worksheet Functions | |||
How can I copy many formulas and keep original cell location? | Excel Discussion (Misc queries) | |||
Moving Cursor & Sheet back to the Original Location | Excel Programming | |||
The Template Wizard retains the original location for my database | Excel Discussion (Misc queries) |