try below
Sub ImportGoodPicture()
Dim WkShape As Shape
' Step 1: Open a directory to select a picture on the PC to open
Dim picFile As Variant
picFile = Application.GetOpenFilename("Pictures (*.jpg;*.jpeg;*.gif;*.bmp;*.png),*.jpg;*.jpeg;*.gif;*.bmp;*.png", , "Select a Picture")
If picFile = False Then Exit Sub
' Step 2: Place the picture in cell E37 and resize it to the width = 36.50 and height = 86
With ActiveSheet.Pictures.Insert(picFile)
Dim N
N = ActiveSheet.Pictures.Count
Set WkRg = Cells(37, 5).Resize(6, 1)
Set WkShape = ActiveSheet.Shapes.AddPicture(picFile, msoFalse, msoCTrue, WkRg.Left, WkRg.Top, WkRg.Width, WkRg.Height)
Set WkRg = Worksheets("sheet1").Cells(13, 8).Resize(6, 3)
Set WkShape = Worksheets("sheet1").Shapes.AddPicture(picFile, msoFalse, msoCTrue, WkRg.Left, WkRg.Top, WkRg.Width, WkRg.Height)
ActiveSheet.Pictures(N).Delete
End With
End Sub
Sub ImportGoodPicture2()
Dim WkShape As Shape
' Step 1: Open a directory to select a picture on the PC to open
Dim picFile As Variant
picFile = Application.GetOpenFilename("Pictures (*.jpg;*.jpeg;*.gif;*.bmp;*.png),*.jpg;*.jpeg;*.gif;*.bmp;*.png", , "Select a Picture")
If picFile = False Then Exit Sub
' Step 2: Place the picture in cell E37 and resize it to the width = 36.50 and height = 86
With ActiveSheet.Pictures.Insert(picFile)
Dim Nn
Nn = ActiveSheet.Pictures.Count
Set WkRg = Cells(37, 11).Resize(6, 1)
Set WkShape = ActiveSheet.Shapes.AddPicture(picFile, msoFalse, msoCTrue, WkRg.Left, WkRg.Top, WkRg.Width, WkRg.Height)
Set WkRg = Worksheets("sheet1").Cells(13, 3).Resize(6, 3)
Set WkShape = Worksheets("sheet1").Shapes.AddPicture(picFile, msoFalse, msoCTrue, WkRg.Left, WkRg.Top, WkRg.Width, WkRg.Height)
ActiveSheet.Pictures(Nn).Delete
End With
End Sub
Bookmarks