Returning Macro to Starting Cell

G

Guest

How do I run a macro and always have the result return to the starting cell.
Meaning, if the cursor is in cell d3 when I launch the macro, I want the last
step of the macro to return to d3. Then the next time I run it, it starts in
e3 and returns to e3. Thanks for your help. Sony
 
B

Bob Phillips

Send the value to ACtivecell.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
D

Dave Peterson

Option explicit
sub test()
Dim ActCell as range

set actcell = activecell

'do your stuff

application.goto actcell

end sub
 
B

Bob Phillips

Save the activecell like this

Set startCell = Activecell

then at the end of the macro, select it

startCell.Select

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 

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