1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
   |  
Sub Imgencommmentaire()
inputbox("Sélectionnez une cellule", Type=8)
With Application.FileDialog(msoFileDialogFilePicker)
         .AllowMultiSelect = False          'Uniquement 1 fichier
         .InitialFileName = CurDir
         .Filters.Clear
         .Filters.Add Description:="Images", Extensions:="*.jpg", Position:=1
         .Title = "Choix de l'image"
 
         If .Show = -1 Then TheFile = .SelectedItems(1) Else TheFile = 0
    End With
'No file selected
If TheFile = 0 Then
MsgBox ("J'te le dis, tu dois sélectionner une image !")
Exit Sub
End If
 
cellulechoisie = InputBox("Veuillez choisir une cellule")
'Type 8 ?
Range("cellulechoisie").AddComment
    Range("cellulechoisie").Comment.Visible = True
[cellulechoisie].Comment.Shape.Fill.UserPicture TheFile
End Sub | 
Partager