1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Sub TriData()
Dim LastRow As Long
With ActiveWorkbook.Worksheets("CombiRoute")
LastRow = Range("A1").End(xlDown).Row
With .Sort
.SortFields.Clear
'Tri par Cost
.SortFields.Add Key:=Range("K2:K" & LastRow), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
.SetRange Range("A2:K" & LastRow)
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
End Sub
Sub FindPath(ByVal Start As String, ByVal Dest As String)
Dim LastRow As Long
With ActiveWorkbook.Worksheets("CombiRoute")
LastRow = Range("A1").End(xlDown).Row
With .Range("A1:K" & LastRow)
.AutoFilter Field:=3, Criteria1:=Start
.AutoFilter Field:=7, Criteria1:=Dest
End With
End With
End Sub |
Partager