VBA copy and pasting into different tab at the end of the last empty row

cynthi263

New Member
Joined
May 14, 2019
Messages
19
i currently have this:

Set wb = ThisWorkbook

Set sh1 = wb.Sheets("Query")
Set sh2 = wb.Sheets("Credits")
Set sh3 = wb.Sheets("Duplicate")
Set sh4 = wb.Sheets("Rev Rvsd")
Set sh5 = wb.Sheets("Rebills")
Set sh6 = wb.Sheets("Pivot")
Set sh7 = wb.Sheets("Work")
Set sh8 = wb.Sheets("Removed")
Set sh9 = wb.Sheets("Validation")
Set sh10 = wb.Sheets("Excluded")

sh5.Range("C2:AW65000").SpecialCells(xlCellTypeVisible).Copy
With sh10
sh10.Cells(1).End(x1up).Row .PasteSpecial xlPasteAll
End With
sh5.Range("C2:AW65000").Offset(1, 0).EntireRow.Delete

i am getting an error on the line in red - i want it to paste the info from sh.5 into sh.10 at the end of the current data that is already there starting with column A.
 
That is not the code that I suggested, it should be
VBA Code:
sh5.Range("C2:AW65000").SpecialCells(xlCellTypeVisible).Copy sh10.Range("A" & Rows.Count).End(xlUp).Offset(1)
which is all one line not two.
i used the one you posted originally but i think i split it out on two lines which is prob why it gave me the error - i'm redoing my entire macro again to see if it will work how you suggested.
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,719
Members
452,995
Latest member
isldboy

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