I have a code for inserting picture inside an active cell but I couldn't figure out a way on how to modify it to insert the picture to be only in column D cells rather than active cell.
Sub InsertPictureInActiveCell()
Dim strFile As String
Dim rng As Range
Dim sh As Shape
Const cFile As String = "Image Files(*.bmp;*.jpg;*.jpeg;*.png),"
strFile = Application.GetOpenFilename(fileFilter:=cFile, Title:=Es)
If strFile = "False" Then
Else
Set rng = ActiveCell
Set rng = rng.MergeArea
With rng
Set sh = ActiveSheet.Shapes.AddPicture(Filename:=strFile,
linkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=.Left,
Top:=.Top, Width:=.Width, Height:=.Height)
sh.LockAspectRatio = msoFalse
sh.Placement = xlMoveAndSize
End With
Set sh = Nothing
Set rng = Nothing
End If
End Sub
I'm still new to VBA. I would be glad if anyone could help me with this situation.