Hello,
I'm trying to get a table that I created and named in my VBA code to sort alphabetically. However when the code reaches the point to call out the range and define the sort parameters (emboldened in the code), it keeps popping up with error code 400. I'm
not sure what the issue is, in part because I used a similar chunk of code in macro that works perfectly fine. Any help would be appreciated.
Dim itemtable As Excel.ListObject
ActiveSheet.UsedRange.Select
Set itemtable = ActiveSheet.ListObjects.Add(xlSrcRange, Selection, , xlYes)
itemtable.Name = "Itemized_Parts_Table"
With itemtable.Sort
.SortFields.Clear
'Issue is here'
.SortFields.Add Key:=Range("Itemized_Parts_Table[Level 1 Install]"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With