Sub Formulaire()
VerifU
Sheets(Range("VF").Value).Select
Display_Userform
End Sub
Sub Display_Userform()
If Range("Accueil!T1") = 1 Then If Not Agent1.Visible Then Agent1.Show
If Range("Accueil!T1") = 2 Then Agent2.Show
If Range("Accueil!T1") = 3 Then Agent3.Show
If Range("Accueil!T1") = 4 Then Agent4.Show
If Range("Accueil!T1") = 5 Then Agent5.Show
If Range("Accueil!T1") = 6 Then Agent6.Show
End Sub
Sub RecupData()
Call RazFormulaire
If Range("Accueil!T1") = 1 Then
Agent1.CommandButton1.Visible = False
If ActiveCell.Offset(0, 0).Value <> "" Then Agent1.ComboBox1 = ActiveCell.Offset(0, 0).Value
If ActiveCell.Offset(0, 1).Value <> "" Then Agent1.TextBox2 = ActiveCell.Offset(0, 1).Value
If ActiveCell.Offset(0, 2).Value <> "" Then Agent1.TextBox3 = ActiveCell.Offset(0, 2).Value
If ActiveCell.Offset(0, 3).Value = "C" Then Agent1.OptionButton1 = True
If ActiveCell.Offset(0, 3).Value = "M" Then Agent1.OptionButton2 = True
If ActiveCell.Offset(0, 4).Value <> "" Then Agent1.TextBox4 = ActiveCell.Offset(0, 4).Value
If ActiveCell.Offset(0, 5).Value <> "" Then Agent1.ComboBox2 = ActiveCell.Offset(0, 5).Value
If ActiveCell.Offset(0, 6).Value <> "" Then Agent1.TextBox5 = ActiveCell.Offset(0, 6).Value
If ActiveCell.Offset(0, 7).Value = "Oui" Then Agent1.CheckBox1 = True
If ActiveCell.Offset(0, 8).Value = "Alarme injustifée" Then Agent1.OptionButton3 = True
If ActiveCell.Offset(0, 8).Value = "Alarme technique" Then Agent1.OptionButton4 = True
If ActiveCell.Offset(0, 8).Value = "Alarme injustifée" Then Agent1.OptionButton3 = True
If ActiveCell.Offset(0, 8).Value = "Alarme technique" Then Agent1.OptionButton4 = True
If ActiveCell.Offset(0, 9).Value <> "" Then Agent1.TextBox6 = ActiveCell.Offset(0, 9).Value
If ActiveCell.Offset(0, 10).Value <> "" Then Agent1.TextBox7 = ActiveCell.Offset(0, 10).Value
If ActiveCell.Offset(0, 11).Value <> "" Then Agent1.TextBox8 = ActiveCell.Offset(0, 11).Value
End If
Display_Userform
End Sub