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
| ' test pour eviter les doublons dans onglet "Clients"
Dim Cellule As Range
Dim TestNomPrenom As String
TestNomPrenom = TextBox2Nom.Value + TextBox3Prenom.Value
With Worksheets("Clients").Range("K3:K65536")
Set Cellule = .Find(TestNomPrenom, Lookat:=xlWhole)
If Cellule Is Nothing Then
'MsgBox ("pas trouvé")
Call EntreeClient
Range("B3:K3000").Sort Key1:=Range("B3"), Order1:=xlAscending, Key2:=Range("C3"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal
End If
End With
'Fermeture de la UserForm les choix et les diffrentes saisies sont perdues effacées
Unload UserForm1
' appel procedure de tri de la feuille "Clients"
'Call TriAlpha
' affichage onglet Acceuil
Worksheets("Acceuil").Select
End Sub
Sub TriAlpha()
With Worksheets("Clients")
Range("B3:K3000").Sort Key1:=Range("B3"), Order1:=xlAscending, Key2:=Range("C3"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal
End With
End Sub |
Partager