Private Sub CommandButton5_Click()
Dim i As Long, l As Long, c As Byte, test As Boolean
'==========================================BOSCO CODE MSGBOX=====================================
With Me 'fait référence à Usf_ajoutrangée
If .TextBox3 = "" Then 'rangée
MsgBox "ajouter Une rangée,svp"
TextBox3.SetFocus
Exit Sub
End If
For i = 1 To 4
If .Controls("OptionButton" & i) = True Then c = i: Exit For
Next i
If c = 0 Then
MsgBox " Vous devez faire un choix vide,exposition,bur,xbur"
Exit Sub
Else
If c = 1 And TextBox4 = "" Then 'bur
MsgBox "Entrer un nouveau bureau,svp"
TextBox4.SetFocus
Exit Sub
End If
If c = 2 And TextBox4 = "" Then 'xbur
MsgBox "Entrer un nouveau bureau,svp"
TextBox4.SetFocus
Exit Sub
End If
End If
If .TextBox9 = "" Then
MsgBox ("Entrer un SERVICE,svp")
TextBox9.SetFocus
Exit Sub
End If
End With
'======================FIN ESSAI BOSCO MSGBOX===========================================
'====================================BOSCO OPTION BOUTON =========================================================
'If Me.TextBox11 <> "" And Me.TextBox3 <> "" And Me.TextBox9 <> "" Then
' OPTION BOUTON==============textbo2 = etage textbox5 = rangée textbox4 = bureau textbox9 = service
If Me.TextBox2 <> "" And Me.TextBox3 <> "" And Me.TextBox4 <> "" And Me.TextBox9 <> "" Then
If Me.OptionButton1 = True Then Me.TextBox4 = Me.OptionButton1.Caption & Me.TextBox4
If Me.OptionButton2 = True Then Me.TextBox4 = Me.OptionButton2.Caption & Me.TextBox4
End If
With Feuil2
If UserForm1.ListEta.List(UserForm1.ListEta.ListIndex, 1) <> "0" Then
l = UserForm1.ListEta.List(UserForm1.ListEta.ListIndex, 1)
Else
l = .Range(a(Li) & 2000).End(xlUp).Row + 1
End If
.Range(a(Li) & l) = UCase(Me.TextBox2) 'etage
.Range(a(Li) & l).Offset(, 1) = UCase(Me.TextBox3) 'rangé
.Range(a(Li) & l).Offset(, 2) = UCase(Me.TextBox4) ' bureau
.Range(a(Li) & l).Offset(, 3) = UCase(Me.TextBox9) 'SERVICE
End With
TriListe 'module2
IniTbl 'module1
With UserForm1
.IniRan 'listran
End With
Unload Me
'End If
End Sub