ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Incremental Cell Movement (https://www.excelbanter.com/excel-programming/309031-incremental-cell-movement.html)

Weasel

Incremental Cell Movement
 
I am using this to move the value in cell E33 to Sheet3 cell E28 but what I'd
like to be able to do is move cell E33 to sheet3 E28 the first run through
and then next run
E33 should go to sheet3 E29 and so on. Is this possible.


Worksheets("sheet1").Range("e33").Copy
Worksheets("sheet3").Range("e28").PasteSpecial _
xlPasteValues
Application.CutCopyMode = False

sebastienm

Incremental Cell Movement
 
I suppose you want it to be written to the first blank cell in column E, am i
right?
In this case:
Worksheets("sheet1").Range("e33").Copy
Worksheets("sheet3").Range("E65536").End(xlup).off set(1,0).PasteSpecial _
xlPasteValues
Application.CutCopyMode = False

Regards,
Sébastien

"Weasel" wrote:

I am using this to move the value in cell E33 to Sheet3 cell E28 but what I'd
like to be able to do is move cell E33 to sheet3 E28 the first run through
and then next run
E33 should go to sheet3 E29 and so on. Is this possible.


Worksheets("sheet1").Range("e33").Copy
Worksheets("sheet3").Range("e28").PasteSpecial _
xlPasteValues
Application.CutCopyMode = False


Tom Ogilvy

Incremental Cell Movement
 
Dim rng as range
Worksheets("sheet1").Range("e33").Copy
set rng = Worksheets("sheet3").Range("e28")
if not isempty(rng) then
if isempty(rng.offset(1,0)) then
set rng = rng.offset(1,0)
else
set rng = rng.End(xldown)
end if
End if
rng.PasteSpecial _
xlPasteValues
Application.CutCopyMode = False

--
Regards,
Tom Ogilvy


"Weasel" wrote in message
...
I am using this to move the value in cell E33 to Sheet3 cell E28 but what

I'd
like to be able to do is move cell E33 to sheet3 E28 the first run through
and then next run
E33 should go to sheet3 E29 and so on. Is this possible.


Worksheets("sheet1").Range("e33").Copy
Worksheets("sheet3").Range("e28").PasteSpecial _
xlPasteValues
Application.CutCopyMode = False





All times are GMT +1. The time now is 07:35 PM.

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