I am working with a table in excel and would like to sort the data in it by the 'Date Submitted'. However, I keep getting the error
"Method 'Range' of Object '_Worksheet' failed.
I have tried numerous ways of accomplishing this but all return the same error.
The code is being written in a separate sheet from the sheet containing the table as that may be a source of the error.
Below is a brief overview of my most recent attempt to resolve this.
Sheets("Database").ListObjects("DatabaseTable").Sort.SortFields.Clear
Sheets("Database").ListObjects("DatabaseTable").Sort.SortFields.Add Key:=Range("DatabaseTable[Date Submitted]"), Order:=xlAscending
Sheets("Database").ListObjects("DatabaseTable").Sort.Apply