Copy rows from two sheet into one with vba

Copper Contributor

Hello, I have two worksheets with columns A - Q to a maximum row 500 that are populated by formulas, however many of the rows will be blank in most cases.

 

I am looking for some VBA that will copy data from these two worksheets (ITDepExport and ITRepExport) to the next available row on another worksheet (TEST). The data in TEST will be uploaded to a web app and cannot contain any of the formatting or formulas in the source worksheets.

 

So far I have found that using .PasteSpecial xlPasteValues does not work as the web app is still identifying something in the blank cells. If I use Ctrl + up or down arrow it also moves to a cell on row 500 so something is being copied.

 

The method of copying below works, but only for one sheet and are not pasting to the next available row. Could anyone help with modifying these or providing another method using VBA?

 

 

 

 

Sub KopyKat()
With Worksheets("ITDepExport")
Worksheets("TEST").Range(.UsedRange.Address).Cells.Value2 = .UsedRange.Value2
End With
End Sub

 

 

0 Replies