Hi There,
i've managed to import an image from an url in my sheet with the following code:
' Code inserts picture from link within 1. with offset from 2.
Sub InsertImage()
Dim Pic As Picture
Application.ScreenUpdating = False
With ActiveSheet.Range("C1") '1
Set Pic = .Parent.Pictures.Insert(.Value)
With .Offset(, -2) '2.
Pic.Top = .Top
Pic.Left = .Left
Pic.Height = 250
End With
End With
Application.ScreenUpdating = True
End Sub
Works fine. But i need to resize the image with max height 250 and the ratio between height en wide need to be true. I searched the internet but can't find anything that works for me.
Also the image must be centered in A1. (From left to right and from top to bottom.
I'm very new to VBA so probally im doing something worng with Dim Pic as Picture (should be shape i guess?) Can someone please help me out, would be much appricieted.
Bookmarks