Option Explicit
Private li As Integer
Private NBacV As Byte
Private NArchV As Integer
Private Sub UserForm_Initialize()
With Metier
.AddItem 'Af'
.AddItem 'Gm'
.AddItem 'Am'
.AddItem 'Brico'
.BoundColumn = 1 'Y A PAS BON DE TRAFIQUER LES PROPRIETES !!! lol
'tu dois enlever = 5 dans la fenêtre propriété mais = 1
End With
With ThisWorkbook.Worksheets('Feuil1')
NBacV = 1 + Int((.Range('J5').Value - 1) / 110)
li = Range('A65535').End(xlUp).Row + 1
NArchV = .Cells(li - 1, 1).Value + 1
NArch.Value = NArchV
NBac.Value = NBacV
End With
End Sub
Private Sub CmdValider_Click()
Dim CTRL As Variant
Dim Col As Byte
For Each CTRL In Array(NClient1, NomPrinc, NomFacul, Localite1, Metier)
If CTRL.Value = '' Then
MsgBox 'Il manque des données!'
Exit Sub
End If
Next CTRL
With ThisWorkbook.Worksheets('Feuil1')
For Each CTRL In Array(NArch, NomPrinc, PrenPrinc, NomFacul, PrenFacul, Localite1, NClient1, Metier, NBacV)
Col = Col + 1
Cells(li, Col).Value = CTRL
Next CTRL
End With
Unload AjoutClient
End Sub
Private Sub CmdAnnuler_Click()
Unload AjoutClient
End Sub