Re : redimensioner une image dans les cellules N36
bonjour Laskoo
pour effacer,adapter feuil1
For Each shp In Feuil1.Shapes
If shp.TopLeftCell.Address = Range("N3").Address Then shp.Delete
Next shp
adapter NOmDisque,NomDossier,NomImage
Sub TestInsertPictureInRange()'pour essai
InsertPictureInRange "E:\NomDossier\NomImage.gif", _
Range("N3
6")
End Sub
Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range)
' inserts a picture and resizes it to fit the TargetCells range
Dim p As Object, t As Double, l As Double, w As Double, h As Double
If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
If Dir(PictureFileName) = "" Then Exit Sub
' import picture
Set p = ActiveSheet.Pictures.Insert(PictureFileName)
' determine positions
With TargetCells
t = .Top
l = .Left
w = .Offset(0, .Columns.Count).Left - .Left
h = .Offset(.Rows.Count, 0).Top - .Top
End With
' position picture
With p
.Top = t
.Left = l
.Width = w
.Height = h
End With
Set p = Nothing
End Sub
à bientôt