VBA - Paste Data Below last row in a diffrent sheet.

borski88

Board Regular
Joined
Jul 3, 2015
Messages
71
Code:
Sub DailyToWeekly()
'Find Last Row
Dim DLR As Long, WLR As Long
DLR = Sheets("Daily").Range("D10000").End(xlUp).Row
WLR = Sheets("Weekly").Range("D10000").End(xlUp).Row

[COLOR=#ff0000]Sheets("Daily").Range("C2:G" & DLR).EntireRow.Copy Destination:=Sheets("Weekly").Range("C1:G" & WLR).End(xlUp).Offset(1, 0)[/COLOR]

End Sub

I am attempting to copy data from Columns C:G in the Daily tab, and past them below the last line in the Weekly Tab. I cannot figure out the issue with the error.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try
Code:
Sub DailyToWeekly()
'Find Last Row
Dim DLR As Long, WLR As Long
DLR = Sheets("Daily").Range("D10000").End(xlUp).Row
WLR = Sheets("Weekly").Range("D10000").End(xlUp).Row

Sheets("Daily").Range("C2:G" & DLR).EntireRow.Copy Destination:=Sheets("Weekly").Range("C" & WLR).Offset(1, 0)

End Sub
 
Upvote 0
Borski88,

Try:
Code:
'If you want to copy the entire row
Sheets("Daily").Rows(2 & ":" & DLR).Copy Destination:=Sheets("Weekly").Rows(WLR + 1)

'If you want to copy just the range
Sheets("Daily").Range("C2:G" & DLR).Copy Destination:=Sheets("Weekly").Range("C" & WLR + 1)

Let me know if these worked.

Bill
 
Upvote 0
Fluff:
Thank you, sadly this also returned an error.

D3allamerican07: Thank you, your 2nd one worked perfectly!
 
Upvote 0
Missed abit
Code:
Sub DailyToWeekly()
'Find Last Row
Dim DLR As Long, WLR As Long
DLR = Sheets("Daily").Range("D10000").End(xlUp).Row
WLR = Sheets("Weekly").Range("D10000").End(xlUp).Row

Sheets("Daily").Range("C2:G" & DLR).Copy Destination:=Sheets("Weekly").Range("C" & WLR).Offset(1, 0)

End Sub
 
Upvote 0
I figured out the solution:
Code:
Sheets("Daily").Range("C2:G" & DLR).Copy
Sheets("Weekly").Range("C" & WLR).Offset(1, 0).PasteSpecial xlPasteValues

thank you everyone!
 
Upvote 0
Try
Code:
Sheets("Weekly").Range("C" & 2).Offset(1).Resize(DLR - 1, 5).Value = Sheets("Daily").Range("C2:G" & DLR).Value
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,227
Members
453,025
Latest member
Hannah_Pham93

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top