Hello,
I am having an issue with my macro. It says "You can't paste this here because the Copy area and paste area aren't the same size."
The object of my macro:
When receiving a new list of invoices, because of how Excel extracts the info from our software, it repeats the information twice or more, but without the ITEM ID. Therefore, I have a macro that selects all the info from Row 6 and on, copies everything in the NEW INVOICES sheet, pastes only the rows with an ITEM ID at the bottom of the previous sheet, then deletes the NEW INVOICES sheet.
Problem:
When there are only two rows (one that is a duplicate with a blank in the ITEM ID), I receive the aforementioned error. However, when there are multiple rows with ITEM IDs, it works correctly.
Here is my Macro's code:
Sub TransferNewRegister()
Dim iRow As Long
For iRow = 1000 To 7 Step -1
If Cells(iRow, "J") = "" Then
Rows(iRow).Delete
End If
Next iRow
Application.Run "'2018 Processed_Invoices.xlsm'!Select_ALL"
Selection.Copy
ActiveSheet.Previous.Select
Application.Run "'2018 Processed_Invoices.xlsm'!BottomCell"
Selection.PasteSpecial Paste:=xlPasteFormulasAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=True, Transpose:=False
ActiveSheet.Next.Delete
End Sub
HERE is a sample of the spreadsheet for your perusal:
[ATTACH]n1205178[/ATTACH]
Any help is appreciated.