1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
Option Explicit 'oblige à déclarer toutes les variables
Option Compare Text 'utilise le texte pour le classement alphabétique
Private x As Byte 'déclare la variable x
Private pl As Range 'déclare la variable pl (PLage)
Private cel As Range 'déclare la variable cel (CELlule)
Private nl As Long 'déclare la variable nl (Numéro de Lige)
Private Sub Frame3_Click()
End Sub
Private Sub Frame4_Click()
End Sub
Private Sub label1_click()
End Sub
Private Sub Label13_Click()
End Sub
Private Sub label2_click()
End Sub
Private Sub OptionButton1_Click()
Call obG1
End Sub
Private Sub OptionButton2_Click()
Call obG1
End Sub
Private Sub OptionButton3_Click()
Call obG2
End Sub
Private Sub OptionButton4_Click()
Call obG2
End Sub
Private Sub ComboBox1_Change()
Me.ListBox1.Clear
For Each cel In pl
If CStr(cel.Value) = CStr(Me.ComboBox1.Value) Then
nl = cel.Row
Me.ListBox1.AddItem Sheets("UT1").Cells(cel.Row, 1)
With Me.ListBox1
.List(.ListCount - 1, 1) = Sheets("UT1").Cells(cel.Row, 2)
.List(.ListCount - 1, 2) = Sheets("UT1").Cells(cel.Row, 3)
.List(.ListCount - 1, 3) = Sheets("UT1").Cells(cel.Row, 4)
.List(.ListCount - 1, 4) = Sheets("UT1").Cells(cel.Row, 5)
.List(.ListCount - 1, 5) = Sheets("UT1").Cells(cel.Row, 6)
.List(.ListCount - 1, 6) = Sheets("UT1").Cells(cel.Row, 7)
.List(.ListCount - 1, 7) = Sheets("UT1").Cells(cel.Row, 8)
.List(.ListCount - 1, 8) = Sheets("UT1").Cells(cel.Row, 9)
.List(.ListCount - 1, 9) = Sheets("UT1").Cells(cel.Row, 10)
.List(.ListCount - 1, 10) = Sheets("UT1").Cells(cel.Row, 11)
.List(.ListCount - 1, 11) = nl
End With
End If
Next cel
If Me.ListBox1.ListCount = 1 Then Me.ListBox1.ListIndex = 0
End Sub
Private Sub UserForm_Initialize()
Me.ListBox2.List = Array("Risque 1", "Risque 2", "Risque 3", "Risque 4", "Risque 5")
End Sub
Private Sub ListBox1_Click()
For x = 0 To 9
Me.Controls("TextBox" & x + 1).Value = Me.ListBox1.Column(x, Me.ListBox1.ListIndex)
Next x
nl = Me.ListBox1.Column(6, Me.ListBox1.ListIndex)
With Me.TextBox1
.SetFocus
.SelStart = 0
.SelLength = Len(.Value)
End With
End Sub
Private Sub CommandButton1_Click()
Dim dest As Range
With Sheets("UT1")
If nl = 0 Then
Set dest = .Cells(Application.Rows.Count, 1).End(xlUp).Offset(1, 0)
Else
Set dest = .Cells(nl, 1)
End If
End With
For x = 0 To 9
dest.Offset(0, x).Value = Me.Controls("TextBox" & x + 1).Value
Next x
Unload Me
UserForm1.Show
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub label3_click()
End Sub
Private Sub Label5_Click()
End Sub
Private Sub Label8_Click()
End Sub
Private Sub TextBox9_Change() |
Partager