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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
| 'Pour la liste déroulante "niveau de relation" ligne DSI (ComboBox2)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox2.ColumnCount = 1 'pour la liste déroulante
ComboBox2.List() = Array("", "inconnu", "peu connu", "connu", "très connu")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("E" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("E" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "niveau de relation" ligne "TEST" (combobox"x")
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Interger 'Ambigous name detected : UserForm_Initialize (Code message : Compil Error)
ComboBox2.Column n
ComboBox"x".ColumnCount = 1 '
End Sub
'Pour la liste déroulante "niveau de relation" ligne DAF (ComboBox9)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox9.ColumnCount = 1 'pour la liste déroulante
ComboBox9.List() = Array("", "inconnu", "peu connu", "connu", "très connu")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("J" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("J" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "niveau de relation" ligne DIR COMPTABLE (ComboBox8)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox8.ColumnCount = 1 'pour la liste déroulante
ComboBox8.List() = Array("", "inconnu", "peu connu", "connu", "très connu")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("O" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("O" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "niveau de relation" ligne ACHAT (ComboBox7)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox7.ColumnCount = 1 'pour la liste déroulante
ComboBox7.List() = Array("", "inconnu", "peu connu", "connu", "très connu")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("T" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("T" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "niveau de relation" ligne ARCHITECTE (ComboBox6)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox6.ColumnCount = 1 'pour la liste déroulante
ComboBox6.List() = Array("", "inconnu", "peu connu", "connu", "très connu")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("Y" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("Y" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "niveau de relation" ligne RESPONSABLE ETUDE (ComboBox5)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox5.ColumnCount = 1 'pour la liste déroulante
ComboBox5.List() = Array("", "inconnu", "peu connu", "connu", "très connu")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("AD" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("AD" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "niveau de relation" ligne RESPONSABLE PRODUCTION (ComboBox4)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox4.ColumnCount = 1 'pour la liste déroulante
ComboBox4.List() = Array("", "inconnu", "peu connu", "connu", "très connu")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("AI" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("AI" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "niveau de relation" ligne CDO (ComboBox3)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox3.ColumnCount = 1 'pour la liste déroulante
ComboBox3.List() = Array("", "inconnu", "peu connu", "connu", "très connu")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("AN" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("AN" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "qualité de la relation" ligne DSI (ComboBox10)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox10.ColumnCount = 1 'pour la liste déroulante
ComboBox10.List() = Array("", "négative", "neutre", "positive")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("F" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("F" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "qualité de la relation" ligne DAF (ComboBox17)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox17.ColumnCount = 1 'pour la liste déroulante
ComboBox17.List() = Array("", "négative", "neutre", "positive")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("K" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("K" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "qualité de la relation" ligne DIRECTEUR COMPTABLE (ComboBox16)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox16.ColumnCount = 1 'pour la liste déroulante
ComboBox16.List() = Array("", "négative", "neutre", "positive")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("P" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("P" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "qualité de la relation" ligne ACHAT (ComboBox15)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox15.ColumnCount = 1 'pour la liste déroulante
ComboBox15.List() = Array("", "négative", "neutre", "positive")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("U" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("U" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "qualité de la relation" ligne ARCHITECTE (ComboBox14)
Private Sub UserForm_Initialize()
Dim J As Long
Dim I As Integer
ComboBox14.ColumnCount = 1 'pour la liste déroulante
ComboBox14.List() = Array("", "négative", "neutre", "positive")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("Z" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("Z" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "qualité de la relation" ligne RESPONSABLE D'ETUDE (ComboBox13)
Private Sub UserForm1_Initialize()
Dim J As Long
Dim I As Integer
ComboBox13.ColumnCount = 1 'pour la liste déroulante
ComboBox13.List() = Array("", "négative", "neutre", "positive")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("AE" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("AE" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "qualité de la relation" RESPONSABLE DE PRODUCTION (ComboBox12)
Private Sub UserForm1_Initialize()
Dim J As Long
Dim I As Integer
ComboBox12.ColumnCount = 1 'pour la liste déroulante
ComboBox12.List() = Array("", "négative", "neutre", "positive")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("AJ" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("AJ" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante "qualité de la relation" ligne CDO (ComboBox11)
Private Sub UserForm1_Initialize()
Dim J As Long
Dim I As Integer
ComboBox11.ColumnCount = 1 'pour la liste déroulante
ComboBox11.List() = Array("", "négative", "neutre", "positive")
Set WS = Sheets("clients") 'Correspond au nom de votre onglet dans le fichier Excel
With Me.ComboBox1
For J = 2 To WS.Range("AO" & Rows.Count).End(x1UP).Row
.AddItem WS.Range("AO" & J)
Next J
End With
For I = 1 To 27
Me.Controls("textBox" & I).Visible = True
Next I
End Sub
'Pour la liste déroulante Code Client
Private Sub ComboBox1_Change()
Dim Ligne As Long
Dim I As Integer
If Me.ComboBox1.ListIndex = -1 Then Exit Sub
Ligne = Me.Combo1.ListIndex + 2
ComboBox2 = WS.Cells(Ligne, "B")
For I = 1 To 27
Me.Controls("TextBox" & I) = WS.Cells(Ligne, I + 2)
Next I
End Sub
'Pour le bouton Nouveau Contact
Private Sub CommandButton1_Click()
Dim L As Integer
If MsgBox("Confirmez-vous l'insertion de ce nouveau contact?", vbYesNo, "Demande de confirmation d'ajout") = vbYes Then
L = Sheets("Clients").Range("a65536").End(x1UP).Row + 1 'pour placer le nouvel enregistrement à la première ligne de tableau non vide
Range("A" & L).Value = ComboBox1
Range("B" & L).Value = ComboBox2
Range("C" & L).Value = ComboBox3
Range("D" & L).Value = ComboBox4
Range("E" & L).Value = ComboBox5
Range("F" & L).Value = ComboBox6
Range("G" & L).Value = ComboBox7
Range("H" & L).Value = ComboBox8
Range("I" & L).Value = ComboBox9
Range("J" & L).Value = ComboBox10
Range("K" & L).Value = ComboBox11
Range("L" & L).Value = ComboBox12
Range("M" & L).Value = ComboBox13
Range("N" & L).Value = ComboBox14
Range("O" & L).Value = ComboBox15
Range("P" & L).Value = ComboBox16
Range("Q" & L).Value = ComboBox17
Range("R" & L).Value = ComboBox18
Range("S" & L).Value = ComboBox19
Range("T" & L).Value = ComboBox20
Range("U" & L).Value = ComboBox21
Range("V" & L).Value = ComboBox22
Range("W" & L).Value = ComboBox23
Range("X" & L).Value = ComboBox24
Range("Y" & L).Value = ComboBox25
Range("Z" & L).Value = ComboBox26
Range("AA" & L).Value = ComboBox27
End If
End Sub
'Pour le bouton Modifier
Private Sub CommandButton2_Click()
Dim Ligne As Long
Dim I As Integer
If MsgBox("confirmez-vous la modification de ce contact?", vbYesNo, "Demande de confirmation de modification") = vbYesNo Then
Me.ComboBox1.ListIndex 2
WS.Cells(Ligne, "B") = ComboBox2
For I = 1 To 27
If Me.Controls("TextBox" & I).Visible = True Then
WS.Cells(Ligne, I + 2) = Me.Controls("TextBox" & I)
End If
Next I
End If
End Sub
'Pour le bouton Quitter
Private Sub CommandButton3_Click()
UnloadMe
End Sub |
Partager