active cell - get me back there

  • Thread starter Thread starter oldyork90
  • Start date Start date
O

oldyork90

NOT a vba guy... macros

I have on that does a lot of formating of a sheet. I want to return
to the cell that was active after the
formating macro is complete. I opened up the macro editor and tried
something like

a = activecell

then later on

a.activate

Thank you.
 
Dim strOriginalAddress As String

strOriginalAddress = ActiveCell.Address
'do stuff
Range(strOriginalAddress).Select

Hope this helps,
Gary Brown
 
You are close. You want to store the activesheet and the active cell. So
something like this perhaps...

dim wks as worksheet
dim rng as range

set wks = activesheet
set rng = activecell

'your code here

wks.select
rng.select
 
Dim strOriginalAddress As String

strOriginalAddress = ActiveCell.Address
'do stuff
Range(strOriginalAddress).Select

Hope this helps,
Gary Brown

Thank you both. Works as if I paid for it. :-)
 

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

Back
Top