Bonsoir,
j'ai créer une petite variable de triage en VBA (pas expert) et j'aimerais avant que la commande débute le triage, valider s'il y a des cellules vides dans la colonne D54 à D660.
Condition:
S'il y a une cellule vide (D54 à D660) j'aimerais avoir une boîte qui indique "la cellule xxx est vide vous devez entrer une valeur avant de trier".
Voici ma commande:
Sub Trier_Etat()
'
' Trier_Etat Macro
'
'
Rows("54:660").Select
ActiveWorkbook.Worksheets("Planification").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Planification").Sort.SortFields.Add Key:=Range( _
"E54:E660"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Planification").Sort.SortFields.Add Key:=Range( _
"A54:A660"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Planification").Sort
.SetRange Range("A54:LK660")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("B54").Select
End Sub
J'ai trouvé cette variable sur internet, je n'y connais pas assez pour la créer.
merci à l'avance.
j'ai créer une petite variable de triage en VBA (pas expert) et j'aimerais avant que la commande débute le triage, valider s'il y a des cellules vides dans la colonne D54 à D660.
Condition:
S'il y a une cellule vide (D54 à D660) j'aimerais avoir une boîte qui indique "la cellule xxx est vide vous devez entrer une valeur avant de trier".
Voici ma commande:
Sub Trier_Etat()
'
' Trier_Etat Macro
'
'
Rows("54:660").Select
ActiveWorkbook.Worksheets("Planification").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Planification").Sort.SortFields.Add Key:=Range( _
"E54:E660"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Planification").Sort.SortFields.Add Key:=Range( _
"A54:A660"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Planification").Sort
.SetRange Range("A54:LK660")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("B54").Select
End Sub
J'ai trouvé cette variable sur internet, je n'y connais pas assez pour la créer.
merci à l'avance.