ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select last dirtied cell (https://www.excelbanter.com/excel-programming/372615-select-last-dirtied-cell.html)

Geebee

select last dirtied cell
 
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


Bob Phillips

select last dirtied cell
 
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)

"geebee" wrote in message
...
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




Tom Ogilvy

select last dirtied cell
 
at the top of your procedure

set cell = ActiveCell

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

would be the best guess.

--
Regards,
Tom Ogilvy


"geebee" wrote:

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


stevebriz

select last dirtied cell
 
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
geebee wrote:
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




All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com