Вы можете использовать метод vba Range.Sort.
Может использоваться следующим образом:
Dim customSortRangeString As String
customSortRangeString = "C1:E5" 'enter in whatever you want
'key1 is the column that you will be sorting based on the first time.
'order1 is the order that it will sort the first time.
'header tells excel that the first row contains headers.
'Note: there are also key2 and key3 (as well as an order for each) allowing you to have multiple
'search criteria.
ActiveWorkbook.Worksheet("YOUR WORKSHEET HERE").Range(customSortRangeString).Sort key1:=Range("C2"), _
order1:=xlAccending, header:=xlYes
Более подробную информацию о методе сортировки можно найти здесь
ОБНОВЛЕНИЕ - 5/9/19 : Добавлена информация для динамического диапазона сортировки на основе критериев, приведенных в комментариях к этому ответу.
Private Sub test()
Dim wb As Workbook
Dim ws As Worksheet
Dim totalRow As Integer
Dim startSortRow As Integer
Dim sortRange As String
Dim sortKey As String
'Setting both the workbook and sheet to variables to make them easier to use.
Set wb = ActiveWorkbook
Set ws = wb.Worksheets("YOUR WORK SHEET")
'getting the total number of rows we may have to loop through to find the appropreate cell.
totalRow = ws.Range("C" & Rows.Count).End(xlUp).Row
'loops through the rows
For a = 1 To totalRow
'checks if the previous cell does not equal the current cell
If ws.Range("C" & a).Value <> ws.Range("C" & a - 1) Then
'if above statement is true, set the startSortRow to the value of a and exit the loop
startSortRow = a
Exit For
End If
Next
'Create the sort range string
sortRange = "A" & startSortRow & ":P100"
'Create the sort key
sortKey = "C" & startSortRow
'Sort based on the values found above
ws.Range(sortRange).Sort key1:=Range(sortKey), order1:=xlAccending, Header:=xlNo
End Sub
Это должно работать должным образом с динамическим диапазоном сортировки. (Не проверял)