Re : creation aleatoir de numero client
Bonjour Philippe et merci pour ta reponse,
effectivement je pourrais générer un numero de maniere logique ca ne change rien effectivement
est il possible de prendre l'année + l'heure par exemple ?
Voici mon code acutel,
J'alimente donc un tableau excel et je voudrais en meme temp crée donc un numero client qui s'implementerais au moment ou je clique sur ajouter
encore merci 🙂
'Bouton "ajouter"
Private Sub CommandButton1_Enter()
'Insertion d'une ligne en feuil2 sur A2:J2
Sheets("BDE_Clients").Select
Selection.Copy
Sheets("BDE_Clients").Select
Selection.Insert Shift:=xlDown
' Insertion des bordures
Range("B2:J2").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
' 2- Copier les valeurs dans les cases "A9:J9"
'Nom, prenom,'adresse,CP ,Telephone 1 & 2, adresse mail, remarque
[B2] = Me.TextBox1.Value
[c2] = Me.TextBox2.Value
[D2] = Me.TextBox5.Value
[E2] = Me.TextBox6.Value
[F2] = Me.TextBox7.Value
[G2] = Me.TextBox8.Value
[H2] = Me.TextBox9.Value
[I2] = Me.TextBox11.Value
[J2] = Me.TextBox10.Value
'[K2] = Me.TextBox10.Value
'Tri Croissant de la feuille " Données"
Range("b2:A158").Select
Selection.Sort Key1:=Range("A2:J9"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("b2:J2").Select
End Sub