Hi...
Hope someone can help...
I want to know if there is a way to get the filename with the image/s inserted into excel?
I have a few merged cells to insert the image with this code:
Sub piccy()
Dim sFile As Variant, r As Range
sFile = Application.GetOpenFilename(FileFilter:="Pic Files (*.jpg;*.bmp;*.png), *.jpg;*.bmp;*.png", Title:="Browse to select a picture")
If sFile = False Then Exit Sub
On Error Resume Next
Set r = Application.InputBox("Click in the cell to hold the picture", Type:=8)
On Error GoTo 0
If r Is Nothing Then Exit Sub
If r.Count > 1 Then Exit Sub
ActiveSheet.Pictures.Insert (sFile)
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.LockAspectRatio = False
.Top = r.Top
.Left = r.Left
.Height = r.MergeArea.Height
.Width = r.MergeArea.Width
End With
End Sub
Now I want to show the image name as well in another cell... Not just picture 1, the actual filename...
PLEASE help!
Bookmarks