I have created some automation to sort/filter columns in an Excel table, but one of the columns is constantly changing on a weekly basis. See 'Week 24' in code below. How can I reference a cell here so it's being updated accordingly?
Sub WKTOJ_HiLo()
'
' WKTOJ_HiLo Macro
'
'
ActiveWorkbook.Worksheets("TOJ by Employee").ListObjects("Table1").Sort. _
SortFields.Clear
ActiveWorkbook.Worksheets("TOJ by Employee").ListObjects("Table1").Sort. _
SortFields.Add Key:=Range("Table1[[#All],[Week 24]]"), SortOn:= _
xlSortOnValues, Order:=xlAscending, DataOption:=xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("TOJ by Employee").ListObjects("Table1").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=Range("E7").Value, _
Criteria1:="<>", Operator:=xlFilterValues
End Sub