Hallo, I have been trying to create a spreadsheet where I can insert images from a local folder directly on a spreasheet. So far I have been able to work with the following code, the only issue I have is that the images are inserted in cell B4 while I need it to be inserted in H5. Does anyone know what piece of code needs to be inserted to get the job done?
Code:
Sub pic()
Dim picname As String
'Get picture name from cell B10 as variable 'picname'
picname = Range("B10")
'Use variable in string'
ActiveSheet.Pictures.Insert("Z:\pictures\" & picname & ".jpg").Select
With Selection
.ShapeRange.LockAspectRatio = msoTrue
.ShapeRange.Height = 200#
.ShapeRange.Width = 200#
.ShapeRange.Rotation = 0#
End With
End Sub