[Solved] Excel VBA sort bug


  1. Key:=source.Range(source.Cells(rowStart, startNames)... – You shouldn’t have source.Range here – your key is the single cell source.Cells(rowStart, startNames).
  2. 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