aşağıdaki kodu vba da çalışma sayfasına insert module diyerek kod olarak yazıp kapatıyorum ama hiçbir şekilde bu kodu kullanamıyorum. makro çalıştır dediğimde gözükmüyor. bi makro kaydedip üzerine düzenle deyip düzenlemeye bu kodu yapıştırdığımda ise expected end sub hatası veriyor. ilk kez makro işleriyle uğrşıyorum sittede epey arama yaptım ama çok basit olduğu için galiba kimse bu baş kısmıyla ilgilenmemiş direk kodlar paylaşılmış ama kodu uygulayamıyorum.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim sPicture As String, pic As Picture
sPicture = Application.GetOpenFilename _
("Pictures (*.gif; *.jpg; *.bmp; *.tif), *.gif; *.jpg; *.bmp; *.tif", _
, "Select Picture to Import")
If sPicture = "False" Then Exit Sub
Set pic = ActiveSheet.Pictures.Insert(sPicture)
With pic
.ShapeRange.LockAspectRatio = msoFalse
.Height = Target.Offset(0, 0).MergeArea.Height - 0.2
.Width = Target.Offset(0, 0).MergeArea.Width - 0.2
.Top = ActiveCell.Top + 0.2
.Left = ActiveCell.Left + 0.2
.Placement = xlMoveAndSize
End With
Set pic = Nothing
Range("F1").Select
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim sPicture As String, pic As Picture
sPicture = Application.GetOpenFilename _
("Pictures (*.gif; *.jpg; *.bmp; *.tif), *.gif; *.jpg; *.bmp; *.tif", _
, "Select Picture to Import")
If sPicture = "False" Then Exit Sub
Set pic = ActiveSheet.Pictures.Insert(sPicture)
With pic
.ShapeRange.LockAspectRatio = msoFalse
.Height = Target.Offset(0, 0).MergeArea.Height - 0.2
.Width = Target.Offset(0, 0).MergeArea.Width - 0.2
.Top = ActiveCell.Top + 0.2
.Left = ActiveCell.Left + 0.2
.Placement = xlMoveAndSize
End With
Set pic = Nothing
Range("F1").Select
End Sub
