Sub tri_minute()
Application.ScreenUpdating = False
Range("A1" ).Select ' Tri de la colonne A depuis A1
Range(Selection, Selection.End(xlDown)).Select ' jusqu'en bas de la colonne A
Selection.Sort Key1:=Range("A1" ), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Application.ScreenUpdating = True
End Sub
Sub start_tri()
Dim PauseTime, Start
If (MsgBox("Démarrer le rafichissement du tri toutes les minutes", 4)) = vbYes Then
Do
PauseTime = 60
Start = Timer Do While Timer < Start + PauseTime
DoEvents ' Donne le contrôle à d'autres processus pour ne pas tout bloquer.
Loop
Call tri_minute
Loop
Else
End
End If
End Sub |