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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
| Option Explicit
Dim Ws As Worksheet
'Permet de déverouiller la touche valider
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
Me.CommandButton3.Enabled = True
Else
Me.CommandButton3.Enabled = False
End If
End Sub
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
'Initialise le userform
Set Ws = Sheets("Bergstik")
With Me.ComboBox1
For J = 8 To Ws.Range("A" & Rows.Count).End(xlUp).Row
.AddItem Ws.Range("A" & J)
Next J
End With
End Sub
Private Sub ComboBox1_Change()
'Permet de retrouver les données associées aux champs
Dim Ligne As Long
Dim I As Integer
If Me.ComboBox1.ListIndex = -1 Then Exit Sub
Ligne = Me.ComboBox1.ListIndex + 8
If Ws.Cells(Ligne, "E") = "OUI" Then
OUI1.Value = True
Else
NON1.Value = True
End If
If Ws.Cells(Ligne, "G") = "OUI" Then
OUI2.Value = True
Else
NON2.Value = True
End If
If Ws.Cells(Ligne, "N") = "OUI" Then
OUI3.Value = True
Else
NON3.Value = True
End If
Nom_Lien.Text = Ws.Cells(Ligne, "F")
Exp.Text = Ws.Cells(Ligne, "H")
WHISKERS.Text = Ws.Cells(Ligne, "I")
UL.Text = Ws.Cells(Ligne, "J")
MSL.Text = Ws.Cells(Ligne, "K")
QUALIF_P.Text = Ws.Cells(Ligne, "L")
SPEC.Text = Ws.Cells(Ligne, "M")
End Sub
Private Sub CommandButton4_Click()
'Bouton annuler que je souhaite configurer
Modif_Bergstik.Hide
End Sub
Private Sub ADD1_Click()
'ADD1 = Bouton "Ajouter Lien"
Range("F8").Select
Application.Dialogs(xlDialogInsertHyperlink).Show
'Nom_Lien = textbox associée
Nom_Lien.Text = Range("F8")
DoEvents
End Sub
Private Sub ADD2_Click()
'ADD2 = Bouton "Ajouter Lien"
Range("I8").Select
Application.Dialogs(xlDialogInsertHyperlink).Show
'WHISKERS = textbox associée
WHISKERS.Text = Range("I8")
DoEvents
End Sub
Private Sub ADD3_Click()
'ADD3 = Bouton "Ajouter Lien"
Range("J8").Select
Application.Dialogs(xlDialogInsertHyperlink).Show
'UL = textbox associée
UL.Text = Range("J8")
DoEvents
End Sub
Private Sub ADD4_Click()
'ADD4 = Bouton "Ajouter Lien"
Range("K8").Select
Application.Dialogs(xlDialogInsertHyperlink).Show
'MSL = textbox associée
MSL.Text = Range("K8")
DoEvents
End Sub
Private Sub ADD5_Click()
'ADD5 = Bouton "Ajouter Lien"
Range("L8").Select
Application.Dialogs(xlDialogInsertHyperlink).Show
'QUALIF_P = textbox associée
QUALIF_P.Text = Range("L8")
DoEvents
End Sub
Private Sub ADD6_Click()
'ADD6 = Bouton "Ajouter Lien"
Range("M8").Select
Application.Dialogs(xlDialogInsertHyperlink).Show
'SPEC.Text = textbox associée
SPEC.Text = Range("M8")
DoEvents
End Sub |
Partager