Bonjour le Forum,
Je me permet de revenir vers vous, car je me suis aperçu que je n’ai pu joindre, hier, le fichier excel…
Il pourrait vous être bien utile pour pouvoir m’aider;
Le problème que je rencontre est que je n’arrive pas, avec la ComboBox, à insérer mes images dans le formulaire, je galère complètement;
Merci à vous!
Voici mon code:
Private Sub ComboBox1_Change()
If Dir(ThisWorkbook.Path & “MEDAILLES” & “” & “Image”) = “” Then
Me.imgPhoto.Picture = LoadPicture("")
Else
Me.imgPhoto.Picture = LoadPicture(ThisWorkbook.Path & “MEDAILLES” & “” & “Image”)
End If
End Sub
Private Sub ComboBox1_Click()
Dim i As Integer
Dim Image As String
Image = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets(“BDD”).Range(“Source”), 44, 0)
On Error GoTo 1
With Me
.TextBox2 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 2, 0)
.TextBox3 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 3, 0)
.TextBox4 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 4, 0)
.TextBox5 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 5, 0)
.TextBox6 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 7, 0)
.TextBox7 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 8, 0)
.TextBox8 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 11, 0)
.TextBox9 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 12, 0)
.TextBox10 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 6, 0)
.TextBox11 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 9, 0)
.TextBox12 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 13, 0)
.TextBox13 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 19, 0)
.TextBox14 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 15, 0)
.TextBox15 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 16, 0)
.TextBox16 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 18, 0)
.TextBox17 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 14, 0)
.TextBox18 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 17, 0)
.TextBox19 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 21, 0)
.TextBox20 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 37, 0)
.TextBox21 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 38, 0)
.TextBox22 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 43, 0)
.TextBox23 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 32, 0)
.TextBox24 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 39, 0)
.TextBox25 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 20, 0)
.TextBox26 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 22, 0)
.TextBox27 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 23, 0)
.TextBox28 = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1), Sheets("BDD").Range("Source"), 44, 0)
If Dir(ThisWorkbook.Path & “MEDAILLES” & “” & “Image”) = “” Then
Me.imgPhoto.Picture = LoadPicture("")
Else
Me.imgPhoto.Picture = LoadPicture(ThisWorkbook.Path & “MEDAILLES” & “” & “Image”)
End If
End With
1
End Sub
LISTE MOBILISÉS 14 18.xlsm (1,2 Mo)