Bonjour,

Dans ce code ,le Textbox3, j'aimerai le remplacer par un ComboBox (faisant le meme role qu'actuellement par le TextBox) allant chercher dans la colonne A de la feuille "serie" les donnèes si trouvant.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Option Explicit
 
Private Sub ComboBox1_Change()
 
End Sub
 
Private Sub CommandButton1_Click()
Dim fin1 As Long
If TextBox1 = "" Or TextBox2 = "" Or TextBox3 = "" Then Exit Sub
prod = TextBox1
If Xprod = 0 Then
fin1 = finf1
Feuil1.Cells(fin1, 1) = TextBox1.Text: Feuil1.Cells(fin1, 2) = TextBox2.Text: Feuil1.Cells(fin1, 3) = TextBox3.Text: Feuil1.Cells(fin1, 10) = photo:
If mini = "" Then Feuil1.Cells(fin1, 11) = -1 Else Feuil1.Cells(fin1, 11) = Val(mini)
dico1
Unload Me
Else
MsgBox ("  Bad entries, you have same HPN  ")
End If
End Sub
 
Private Sub CommandButton2_Click()
change = False
Unload Me
End Sub
 
Private Sub CommandButton3_Click()
Dim a
a = Application.GetOpenFilename("Fichier jpg;gif;bmp;tif,*.jpg ;*.tif;*.gif;*.jpg")
If a <> False Then Imag.Picture = LoadPicture(a): photo = a
End Sub
 
Private Sub CommandButton4_Click()
Imag.Picture = LoadPicture(""): photo = ""
End Sub
 
Private Sub TextBox1_Change()
 
End Sub
 
Private Sub UserForm_Activate()
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
photo = ""
mini = ""
Imag.Picture = LoadPicture("")
End Sub
J'ai bien enregistrer une macro mais je ne sais comment remplacer ces donnèes :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Sub Macrotest()
'
' Macrotest Macro
'
 
'
    ActiveSheet.DropDowns.Add(209.25, 246, 281.25, 62.25).Select
    With Selection
        .ListFillRange = "$A:$A"
        .LinkedCell = "$E$7"
        .DropDownLines = 8
        .Display3DShading = False
    End With
End Sub
Merci de votre aide