Good morning Chandoo Team,
Can't figure out why this segment of code (in bold) keeps receiving a 1004 error; Method 'Range' of object '_Worksheet failed:
>>> use code - tags <<<
I'm running the macro from a command button in a different tab. Just trying to sort Column G (dates) in ascending order.
Thanks in advance for the help
stratman
Can't figure out why this segment of code (in bold) keeps receiving a 1004 error; Method 'Range' of object '_Worksheet failed:
>>> use code - tags <<<
Code:
'Sort Table by Start Date
Sheets("Clockify").Select
ActiveWorkbook.Worksheets("Clockify").ListObjects("Clockify").Sort.SortFields. _
Clear
' >>>> bolded
ActiveWorkbook.Worksheets("Clockify").ListObjects("Clockify").Sort.SortFields. _
Add Key:=Range("Clockify[[#All],[Start Date]]"), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortTextAsNumbers
' <<<< bolded
With ActiveWorkbook.Worksheets("Clockify").ListObjects("Clockify").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Thanks in advance for the help
stratman
Last edited by a moderator: