muhammad susanto
Well-known Member
- Joined
- Jan 8, 2013
- Messages
- 2,102
- Office Version
- 365
- 2021
- Platform
- Windows
hi expert..
i found code to Inserting picture in a cell (autofit), but this code work in single cell..
i want this code working on single cell and merged cell
here this code (how to modify it)
anyone help me, thank very much
.sst
i found code to Inserting picture in a cell (autofit), but this code work in single cell..
i want this code working on single cell and merged cell
here this code (how to modify it)
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.Height
.Width = ActiveCell.Width
.Top = ActiveCell.Top
.Left = ActiveCell.Left
.Placement = xlMoveAndSize
End With
Set pic = Nothing
End Sub
anyone help me, thank very much
.sst