I'm trying to understand the problem with the following code:
So in summary, if a certain value matches between sheet1 and sheet2, copy the row that holds that value in sheet1 and paste it in sheet3. Then copy the row holding that value in sheet2 and paste it in sheet3 in the same row as the matching data.
I know the row and RO look funny but it works. What doesn't work and what I've been trying to understand is part where I try to paste the data from sheet2 into sheet3. I have it set to paste into empty cells (hence the cells(RO,23).select) but it still says run-time error 1004 cant copy and paste because the size and shape isnt the same.
But I don't understand the issue. The cells aren't even occupied. Why wont it just paste?
Code:
If x = y Then
Sheets("Sheet1").Select
Cells(row, 1).Select
Selection.EntireRow.Copy
Sheets("Sheet3").Select
Cells(row, 1).Select
ActiveCell.PasteSpecial
Sheets("Sheet2").Select
Cells(RO, 2).Select
Selection.EntireRow.Copy
Sheets("Sheet3").Select
Cells(row, 23).Select
ActiveCell.PasteSpecial
End If
So in summary, if a certain value matches between sheet1 and sheet2, copy the row that holds that value in sheet1 and paste it in sheet3. Then copy the row holding that value in sheet2 and paste it in sheet3 in the same row as the matching data.
I know the row and RO look funny but it works. What doesn't work and what I've been trying to understand is part where I try to paste the data from sheet2 into sheet3. I have it set to paste into empty cells (hence the cells(RO,23).select) but it still says run-time error 1004 cant copy and paste because the size and shape isnt the same.
But I don't understand the issue. The cells aren't even occupied. Why wont it just paste?