I'm getting a run-time error when I run the following code:
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
Application.DisplayStatusBar = False
Application.EnableEvents = False
Dim c, OrgList, vtList, FndRng As Range
Dim Tbl As ListObject
Dim NewRow As ListRow
Dim Org, Track As Worksheet
Set Org = ActiveWorkbook.Worksheets("Org List")
Set Track = ActiveWorkbook.Worksheets("Visit Tracking Sheet")
Set Tbl = Track.ListObjects("TrackTbl")
Set OrgList = Org.Range(Cells(2, 1), Cells(Org.UsedRange.Rows.Count, 1))
Set vtList = Track.Range("TrackTbl[Org ID]")
Everything runs fine until I get to Set ChngList = Track.Range("TrackTbl[Org ID]")
which throws the Run-time Error: 1004
. I have tried also the following replacement lines, all of which throw the same error:
Set vtList = Tbl.Range(Cells(2, 1), Cells(ListRows.Count, 1))
Set vtList = Track.Range(Cells(2, 1), Cells(Track.UsedRange.Rows.Count, 1))
Set vtList = Track.Tbl.Range(Cells(2, 1), Cells(ListRows.Count, 1))
Set vtList = Tbl.Range
I'm at a loss on this one and have had trouble finding a solution for this. I assume it is an issue with setting the Range referencing cells in a Table but am not sure.