ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Paste a range and shifting away existing data (https://www.excelbanter.com/excel-programming/450020-paste-range-shifting-away-existing-data.html)

[email protected]

Paste a range and shifting away existing data
 
Hello,

I am looking a way for copying a range to an active cell such that all the data right to the active cell remain unaffected and move to the right accordingly to leave space to the new range

Avi
Thanks

Auric__

Paste a range and shifting away existing data
 
metricsinstitute wrote:

I am looking a way for copying a range to an active cell such that all
the data right to the active cell remain unaffected and move to the
right accordingly to leave space to the new range


Shift first, then copy:

ActiveCell.Insert Shift:=xlShiftToRight
Cells(1, 1).Copy Destination:=ActiveCell

(Replace Cells(1, 1) with the range actually being copied.)

--
Be not too eager to deal out death in the name of justice,
fearing for your own safety. Even the wise cannot see all ends.


All times are GMT +1. The time now is 10:25 PM.

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