Excel Insert Picture using VBA

preview_player
Показать описание
Sub insert_Pic()
Dim shp As Picture
Dim rng As Range, L, T, W, H
Set rng = Range("D5:H14")
With rng.Offset
L = .Left
T = .Top
W = .Width
H = .Height
End With

Set shp = ActiveSheet.Pictures.Insert("Your Picture File")
With shp
.Name = "MyPic"
'.ShapeRange.LockAspectRatio = msoFalse
.Left = L
.Top = T
.Width = W
.Height = H

End With

End Sub
Рекомендации по теме
Комментарии
Автор

how would you do it so that i can select what picture and from what location to pull the picture from ?

jerryreyes