ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy/Paste problem (https://www.excelbanter.com/excel-programming/384830-copy-paste-problem.html)

Dan R.

Copy/Paste problem
 
I know this is simple, but how do I shift the paste of dRange down 1
row? I'm pretty sure I need to use offset somewhere but I can't figure
out where.

LC = Lastcol(WB2.Sheets(2)) + 1

Set sRange = WB1.Columns("A:M")
Set dRange = WB2.Sheets(2).Columns(LC)

sRange.Copy dRange


Thanks,
-- Dan


Otto Moehrbach

Copy/Paste problem
 
dRange.Offset(1)
HTH Otto
"Dan R." wrote in message
ups.com...
I know this is simple, but how do I shift the paste of dRange down 1
row? I'm pretty sure I need to use offset somewhere but I can't figure
out where.

LC = Lastcol(WB2.Sheets(2)) + 1

Set sRange = WB1.Columns("A:M")
Set dRange = WB2.Sheets(2).Columns(LC)

sRange.Copy dRange


Thanks,
-- Dan




merjet

Copy/Paste problem
 
You can copy 'Columns to Columns' or 'Range to Range', but not
'Columns to a Range'.
Try something like this:

Set sRange = WB1.Range("A1:M10")
Set dRange = WB2.Sheets(2).Cells(2, LC)
sRange.Copy dRange

Hth,
Merjet



Dan R.

Copy/Paste problem
 
That's right, thanks merjet.

-- Dan



All times are GMT +1. The time now is 01:30 PM.

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