hi all,
I have searched for ages and can find plenty of references to resize a cell to a picture....... but I want a picture to resize to the cells size.
I do not want to use a cell note
the size of the cells have been set at ht 225 width 58
i understand that what I want may distort the image but thats ok for my need
thanks to the board I currently use this, which is great , but only if the images imported are the same size
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)
ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Select
Selection.ShapeRange.ScaleWidth 0.64, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.64, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.97, msoFalse, msoScaleFromTopLeft
End If
End Sub
I presume it is the last three lines I need to rejig.
tia kd
I have searched for ages and can find plenty of references to resize a cell to a picture....... but I want a picture to resize to the cells size.
I do not want to use a cell note
the size of the cells have been set at ht 225 width 58
i understand that what I want may distort the image but thats ok for my need
thanks to the board I currently use this, which is great , but only if the images imported are the same size
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)
ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Select
Selection.ShapeRange.ScaleWidth 0.64, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.64, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.97, msoFalse, msoScaleFromTopLeft
End If
End Sub
I presume it is the last three lines I need to rejig.
tia kd