muhammad susanto
Well-known Member
- Joined
- Jan 8, 2013
- Messages
- 2,089
- Office Version
- 365
- 2021
- Platform
- Windows
hi all...
the code below work properly..i just want to set margin top, bottom, left, right in a cell..i want to the picture not "fill full" a cell
to compare please, see my attactment picture
the code below work properly..i just want to set margin top, bottom, left, right in a cell..i want to the picture not "fill full" a cell
VBA Code:
Sub InsertPicture()
Dim sPicture As String, pic As Picture
sPicture = Application.GetOpenFilename _
("Pictures (*.gif; *.jpg; *.bmp; *.tif), *.gif; *.jpg; *.bmp; *.tif", _
, "Select Picture to Import")
If sPicture = "False" Then Exit Sub
Set pic = ActiveSheet.Pictures.Insert(sPicture)
With pic
.ShapeRange.LockAspectRatio = msoFalse
.Height = ActiveCell.MergeArea.Height
.Width = ActiveCell.MergeArea.Width
.Top = ActiveCell.MergeArea.Top
.Left = ActiveCell.MergeArea.Left
.Placement = xlMoveAndSize
End With
Set pic = Nothing
End Sub
to compare please, see my attactment picture