Re : Assigné une image a une cellule avec liste déroulante
alors juste pour savoir,
voici mon code
Sub Bouton5_Cliquer()
Dim objFeuille As Worksheet, objPict As Picture
For Lig = 24 To 100
If Cells(Lig, 11).Value = "Créer" Then
Set objFeuille = ActiveSheet
Set objPict = objFeuille.Pictures.Insert("\\file.media.int\Users_RTS\DurandJu\Desktop\creer.jpg")
With objPict
.Left = Cells(Lig, 6).Left
.Top = Cells(Lig, 6).Top
.Height = Cells(Lig, 6).Height
.Width = Cells(Lig, 6).Width
End With
Else
If Cells(Lig, 11).Value = "Supprimer" Then
Set objFeuille = ActiveSheet
Set objPict = objFeuille.Pictures.Insert("\\file.media.int\Users_RTS\DurandJu\Desktop\supprimer.jpg")
With objPict
.Left = Cells(Lig, 6).Left
.Top = Cells(Lig, 6).Top
.Height = Cells(Lig, 6).Height
.Width = Cells(Lig, 6).Width
End With
Else
If Cells(Lig, 11).Value = "Ne pas toucher" Then
Set objFeuille = ActiveSheet
Set objPict = objFeuille.Pictures.Insert("\\file.media.int\Users_RTS\DurandJu\Desktop\rien faire.jpg")
With objPict
.Left = Cells(Lig, 6).Left
.Top = Cells(Lig, 6).Top
.Height = Cells(Lig, 6).Height
.Width = Cells(Lig, 6).Width
End With
End If
End If
End If
Next Lig
End Sub
la ou veux améliorer une chose c'est que je veux que si la cellule Lig,11 contient déjà quelque choses, qu'il ne me remette pas l'image par dessus... car a chaque appuie sur mon bouton il rajoute des images par dessus les autres...