Re : Formulaire avec liste en cascade
Tu supprimes l'image dans le usf
tu supprimes les lignes en gras de la procédure 😛rivate Sub combobox10_Change()
Private Sub ComboBox10_Change()
If ComboBox10 = "" Then Exit Sub
With ComboBox10
'.SelectedItem.ForeColor = &HFF0000
Rng = Val(ComboBox10.Column(1)) '.ListIndex(0, 1)
'Stop
'Rng = Val(.SelectedItem.ListSubItems(1).Text)
'TextNom = .SelectedItem
TextBox7 = Cells(Rng, 3)
TextBox8 = Cells(Rng, 4)
recherche = TextBox7
End With
'Set Plage = Sheets("base de données").Range("A26:A29") 'c2", Cells(Rows.Count, "c").End(xlUp))
Set Plage = Sheets("Image").Range("A2:A129") 'c2", Cells(Rows.Count, "c").End(xlUp))
With Plage
Set c = .Find(recherche)
If Not c Is Nothing Then
imag1 = c.Offset(0, 2)
adresse = c.Address
imag2 = c.Offset(0, 3)
'Stop
'Sheets("base de données").Activate
Set f = Sheets("Image")
' For Each s In f.Shapes
' Me.ComboBox11.AddItem s.Name
' Next
'Stop
'Exit Sub
Set s = f.Shapes(CStr(imag1))
s.CopyPicture
f.ChartObjects.Add(0, 0, s.Width, s.Height).Chart.Paste
f.ChartObjects(1).Chart.Export Filename:="monimage.jpg"
f.Shapes(f.Shapes.Count).Delete
Me.Image2.PictureSizeMode = fmPictureSizeModeZoom
Me.Image2.Picture = LoadPicture("monimage.jpg")
Kill "monimage.jpg"
End If
End With
End Sub