Help with macro

T

Tom

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
 
B

Bernie Deitrick

Tom,

Dim myOrigSelection As Range


Set myOrigSelection = Selection

'Other Code

'To go back
myOrigSelection.Select

HTH,
Bernie
MS Excel MVP
 
D

Dave Peterson

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
 

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

Top