mark active cell and return to paste

J

J.W. Aldridge

after macro is run

....i want to run another macro starting in the exact cell that the
previous code ended in.


mark active cell
Range("R4").Select
Selection.Copy
return to "active cell"
ActiveSheet.Paste
 
P

Per Jessen

No need to use select, it is just slowing down the code:

Range("R4").Copy ActiveCell

or the more descriptive one:
Range("R4").Copy Destination:=ActiveCell

Regards,
Per
 
J

Jef Gorbach

after macro is run

...i want to run another macro starting in the exact cell that the
previous code ended in.

mark active cell
    Range("R4").Select
    Selection.Copy
return to "active cell"
    ActiveSheet.Paste

Unless I'm misreading, it sounds like you want to save the location of
the last active cell processed by Macro-A (for instance) to
<someplace> so Macro-B can begin its own processing from that
location.

A public global variable would allow you to pass Macro-A's last active
cell location to Macro-B, however only if they run during the same
session -- otherwise the easiest way I can think of is for Macro-A to
save the location to an otherwise unused known location (ie: cell
IV65536) so Macro-B can assign it to its own variable when it begins
processing.
 

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