Hi Oberon70
You have to edit the Sub AddInvToArray, the error is at myNewRow = rngInvNum.Cells(rw, 1).Value because myNewRow is ListRow data type.
Please change to myNewRow.Range.Columns(1) = rngInvNum.Cells(rw, 1).Value
Also, I think you need to add a new row after inserting, if not, then the new value will overwrite the older value.
My suggestion as below.
Sub AddInvToArray()
Dim myNewRow As ListRow
Set myNewRow = LoTempTbl.ListRows.Add
x = 1
RAgent = "Wayne Enterprise"
For rw = rngAgent.Rows.Count To 1 Step -1
If rngAgent.Cells(rw, 1) = RAgent And _
rngReceipt.Cells(rw, 1) = "" And _
rngBatchRpt.Cells(rw, 1) = "" _
Then
' Do something
' LoInvNum.Add = rngInvNum.Cells(rw, 1).Value
Debug.Print rngInvNum.Cells(rw, 1).Value
'rngTempTbl.Cells(x).Value = rngInvNum.Cells(rw, 1).Value
myNewRow.Range.Columns(1) = rngInvNum.Cells(rw, 1).Value
Set myNewRow = LoTempTbl.ListRows.Add
x = x + 1
End If
Next rw
End Sub
Bookmarks