#1   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 20
Default Help with macro

The last line of my code reads, "Selection.End(xlDown).Select", which is my
reference position on the spreadsheet. Then the macro carries out other
tasks moving the active cell elsewhere. How can I get back to my reference
position? I can't use define to fix that position as this location is
different when the macro is used on other spreadsheets. Thanks for any help.

TIA
Tom


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Help with macro

Tom,

Dim myOrigSelection As Range


Set myOrigSelection = Selection

'Other Code

'To go back
myOrigSelection.Select

HTH,
Bernie
MS Excel MVP


"Tom" wrote in message
...
The last line of my code reads, "Selection.End(xlDown).Select", which is
my reference position on the spreadsheet. Then the macro carries out other
tasks moving the active cell elsewhere. How can I get back to my reference
position? I can't use define to fix that position as this location is
different when the macro is used on other spreadsheets. Thanks for any
help.

TIA
Tom




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Help with macro

Dim ActCell as Range
'start by saving the current activecell
set actcell = activecell
'do as much as you want
'go back to that original activecell
application.goto actcell ', scroll:=true

Tom wrote:

The last line of my code reads, "Selection.End(xlDown).Select", which is my
reference position on the spreadsheet. Then the macro carries out other
tasks moving the active cell elsewhere. How can I get back to my reference
position? I can't use define to fix that position as this location is
different when the macro is used on other spreadsheets. Thanks for any help.

TIA
Tom


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 20
Default Help with macro

My thanks to Bernie and Dave. Your assistance is much appreciated.

Tom

"Tom" wrote in message
...
The last line of my code reads, "Selection.End(xlDown).Select", which is
my reference position on the spreadsheet. Then the macro carries out other
tasks moving the active cell elsewhere. How can I get back to my reference
position? I can't use define to fix that position as this location is
different when the macro is used on other spreadsheets. Thanks for any
help.

TIA
Tom




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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM


All times are GMT +1. The time now is 10:12 PM.

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

About Us

"It's about Microsoft Excel"