select last dirtied cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI,

I would like to know how to write the code that goes back to the last
"dirtied" cell (i.e. the cell which I last typed data in before performing
VBA to copy in a cell at the top of the worksheet).

Thanks in advance,
geebee
 
If you don't do any selecting in your code, won't it still be active?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
at the top of your procedure

set cell = ActiveCell

then when you want to return
application.Goto cell, true

would be the best guess.
 
here is an idea for you.

Sub test()
dirty_cell = ActiveCell.Address

'then
' do stuff here
'at the end of your macro

Range(dirty_cell).Select
End Sub
 

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