Private Sub UserForm_Initialize()
....................................................
With Me.ComboBox3
.Clear
.ColumnCount = 2
.ColumnWidths = "60;0"
.Style = fmStyleDropDownList '
For Each c In Range(Sheets("Recap").[A4], Sheets("Recap").[A65000].End(xlUp))
If c.Offset(0, 10) = "" And c.Offset(0, 11) = "" And c.Offset(0, 12) = "" Then
.AddItem c
.List(.ListCount - 1, 1) = c.Row
End If
Next c
.ListIndex = 0
End With
End Sub
Private Sub CommandButton2_Click()
Dim lig As Long
If Me.ComboBoxGrade.Value = "" Then
Call MsgBox("Vous devez indiquer le grade du demandeur" _
& vbCrLf & "" _
& vbCrLf & "" _
, vbCritical, Application.Name)
Me.ComboBoxGrade.SetFocus
Exit Sub
End If
If Me.ComboBoxNom.Value = "" Then
Call MsgBox("Vous devez indiquer le demandeur" _
& vbCrLf & "" _
& vbCrLf & "" _
, vbCritical, Application.Name)
Me.ComboBoxNom.SetFocus
Exit Sub
End If
If Me.TextBox5.Value = "" Then
Call MsgBox("Vous devez compléter la zone " _
& vbCrLf & "" _
& vbCrLf & "" _
, vbCritical, Application.Name)
Me.TextBox5.SetFocus
Exit Sub
End If
With Sheets("Recap")
lig = CLng(ComboBox3.List(ComboBox3.ListIndex, ComboBox3.ColumnCount - 1))
.Range("K" & lig) = Me.ComboBoxGrade
.Range("L" & lig) = Me.ComboBoxNom
.Range("M" & lig) = Me.TextBox5
.Range("j" & lig) = Date
End With
Set WS = ThisWorkbook.Sheets("MENU")
WS.Select
Unload UserForm2
End Sub