Here is the piece of code I am working with:
I get an error message saying that the Paste method failed on the range or something like that. I am copying a range from wsRes and pasting it in a table located in wsdata. Why is this happening???
Thank you for the help in advance.
Code:
For row = 1 To 25
If Left(wsRes.Cells(row, 1).Value, 2) = "MC" Or Left(wsRes.Cells(row, 1).Value, 2) = "LS" Then
wsRes.Cells.Range("A" & row, "J" & row).Copy
wsdata.Range("Table1[Centro]").ListObject.ListRows.Add (1)
wsdata.Range("A5").PasteSpecial Paste:=xlPasteValues
wsdata.Cells(5, 11).Value = MyYear
wsdata.Cells(5, 12).Value = MyMonth
If MyYear = 2008 Or MyYear = 2009 Or (MyYear = 2010 And MyMonth < 4) Then
Range("H5:I5").Cut Destination:=Range("I5:J5")
End If
End If
I get an error message saying that the Paste method failed on the range or something like that. I am copying a range from wsRes and pasting it in a table located in wsdata. Why is this happening???
Thank you for the help in advance.