Key:=source.Range(source.Cells(rowStart, startNames)...
– You shouldn’t havesource.Range
here – your key is the single cellsource.Cells(rowStart, startNames)
.- As a recommendation – change
...SortFields.Add2
to...SortFields.Add
. The..Add2
will definitely not work in older versions of Excel.
solved Excel VBA sort bug