Inserting Pictures And Resize To Active Cell Shape


I now have this code that inserts a picture and then resizes it the active cell shape.

Sub InsertPicture()

Dim myPicture As String

myPicture = Application.GetOpenFilename _
("Pictures (*.gif; *.jpg; *.bmp; *.tif),*.gif; *.jpg; *.bmp; *.tif", , "Select Picture to Import")

If myPicture "" Then

ActiveSheet.Pictures.Insert (myPicture)
With Selection

.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.Height = ActiveCell.RowHeight
.ShapeRange.Width = ActiveCell.Width
.Placement = xlMoveAndSize
End With
End If

End Sub