This routine will prompt you for the file location
Then ask you for the Top cell location to paste to.
Sub Insert_Pict()
Dim Pict
Dim ImgFileFormat As String
Dim PictCell As Range
Dim Ans As Integer
'ActiveSheet.Protect True, True, True, True, True
ImgFileFormat = "Image Files wmf (*.wmf),*.wmf,(*.bmp),others , jpg (*.jpg),*.jpg"
GetPict:
Pict = Application.GetOpenFilename(ImgFileFormat)
'Note you can load in nearly file format
If Pict = False Then End
Ans = MsgBox("Open : " & Pict, vbYesNo, "Insert Picture")
If Ans = vbNo Then GoTo GetPict
'Now paste to userselected cell
GetCell:
Set PictCell = Application.InputBox("Select the cell to insert into", Type:=8)
If PictCell.Count > 1 Then MsgBox "Select ONE cell only": GoTo GetCell
PictCell.Select
ActiveSheet.Pictures.Insert(Pict).Select
End Sub
Ivan
to delete ALL picture files then;
Sub DeletePicts()
Dim Pict As Object
For Each Pict In ActiveSheet.Shapes
MsgBox Pict.Name & ":" & Pict.Type
If Pict.Type = 13 Then
Pict.Delete
End If
Next
End Sub
Ivan
Ivan,
Thanks a lot!
Regards
Oscar