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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Sub Maj_Rdv(ByVal FeuilleRdv As Worksheet)
Dim AireATrier As Range, CelluleCritere As Range
With FeuilleRdv
.Unprotect
Set AireATrier = .Range("A14:N100")
Set CelluleCritere = .Range("A14")
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=CelluleCritere, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With .Sort
.SetRange AireATrier
.Header = xlNo ' Attention l'entête n'est pas comprise
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
.Rows.AutoFit
.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End With
Set AireATrier = Nothing
Set CelluleCritere = Nothing
End Sub
Sub EssaiMaj_Rdv()
Dim I As Integer
Dim MaListeDOnglets As Variant
Dim MonOnglet As Worksheet
MaListeDOnglets = Array("01", "02", "03", "04", "05") ' A compléter
For I = LBound(MaListeDOnglets) To UBound(MaListeDOnglets)
For Each MonOnglet In Sheets
If MonOnglet.Name = MaListeDOnglets(I) Then
Maj_Rdv MonOnglet
End If
Next MonOnglet
Next I
End Sub |