|
Worksheet_BeforeDoubleClickを使います。
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Fname As String
Dim mySh As Shape
Cancel = True
Fname = Application.GetOpenFilename _
(filefilter:="JPEG形式(*.jpg), *.jpg", _
Title:="画像を選択して下さい")
If Fname = "False" Then Exit Sub
With ActiveSheet
Set mySh = .Shapes.AddPicture(Filename:=Fname, _
linktofile:=True, savewithdocument:=False, _
Left:=Selection.Left, Top:=Selection.Top, _
Width:=Selection.Width, _
Height:=Selection.Height)
End With
' ChDir ThisWorkbook.Path
End Sub
|
|