Hello,
I'm getting a compile error: Wrong number of arguments or invalid property assignment. The portion of code highlighted after I click "Ok" is in large, red text below.
This is the portion of code that is apparently having the issue (in red and bold text):
ws2.Paste Destination:=ws2.Range(ws2.Cells(x, 1), ws2.Cells(x, 2), ws2.Cells(x, 3), ws2.Cells(x, 4), ws2.Cells(x, 5), ws2.Cells(x, 6), ws2.Cells(x, 7))
Thank you for your help!
I'm getting a compile error: Wrong number of arguments or invalid property assignment. The portion of code highlighted after I click "Ok" is in large, red text below.
VBA Code:
Sub ListingData()
Dim i, x, numRow, numColumn, numValue As Integer
Dim rowCount As Long
Dim ws1, ws2 As Worksheet
Set ws1 = Sheets("Req")
Set ws2 = Sheets("Work")
Dim myTable As ListObject
Set myTable = ActiveSheet.ListObjects("Table3")
x = 2
rowCount = myTable.DataBodyRange.Rows.count + 5
For i = 5 To rowCount
If ActiveSheet.Cells(i, 7).Value = "N" Then
ws1.Range(ws1.Cells(i, 2), ws1.Cells(i, 3), ws1.Cells(i, 4), ws1.Cells(i, 5), ws1.Cells(i, 6), ws1.Cells(i, 7)).Copy
ws2.Paste Destination:=ws2.Range(ws2.Cells(x, 1), ws2.Cells(x, 2), ws2.Cells(x, 3), ws2.Cells(x, 4), ws2.Cells(x, 5), ws2.Cells(x, 6), ws2.Cells(x, 7))
x = x + 1
End If
Next i
End Sub
This is the portion of code that is apparently having the issue (in red and bold text):
ws2.Paste Destination:=ws2.Range(ws2.Cells(x, 1), ws2.Cells(x, 2), ws2.Cells(x, 3), ws2.Cells(x, 4), ws2.Cells(x, 5), ws2.Cells(x, 6), ws2.Cells(x, 7))
Thank you for your help!