- Katılım
- 9 Mayıs 2013
- Mesajlar
- 7
- Excel Vers. ve Dili
- excel 2012
english
Arkadaşlar elimde film listesi excel dosyası var ben buna makro eklemek istedim ( visual basic ) her türlü yapıyorum dosyayı kapatmadan makro düzgün çalışıyor fakat excel dosyasını kapatım sonra tekrar açtığımda ne makro çalışıyor ne de yazdığım o kodlar görünüyor hepsi siliniyor nerede hata yaptığımı anlamadım ekte dosyayı ve resimlerin birazını göndericem toplam 300 kb boyut . yardımcı olursanız çok memnun olurum şimdiden teşekkürler
Yazdığım kod :
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim hcr As Range
Dim c As Integer
Dim yuk As Double, gen As Double
Columns("D").ClearComments
If Intersect(Target, [C4:C1500]) Is Nothing Then Exit Sub
If Target.Count > 5 Then Exit Sub
With Cells(Target.Row, "D")
.AddComment
.Comment.Visible = True
.Comment.Shape.Select True
End With
On Error GoTo yok
'Selection.ShapeRange.Fill.UserPicture "D
oster\" & Cells(Target.Row, "D") & ".jpg"'Poster Klasörü D Sürücüsünde OLmalı
Selection.ShapeRange.Fill.UserPicture (ThisWorkbook.Path & "\Poster\" & Cells(Target.Row, "D") & ".jpg") 'Poster Klasörü Excel Dosyası İle Ayni Yerde Olmalı
Selection.Height = 250 'yuk
Selection.Width = 150 'gen
Exit Sub
yok:
Selection.Height = 100 'yuk
Selection.Width = 100 'gen
'Selection.ShapeRange.Fill.UserPicture "D:\Poster\1Hata.jpg"'Poster Klasörü D Sürücüsünde OLmalı
Selection.ShapeRange.Fill.UserPicture (ThisWorkbook.Path & "\Poster\1hata.jpg") 'Poster Klasörü Excel Dosyası İle Ayni Yerde Olmalı
End Sub
Yazdığım kod :
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim hcr As Range
Dim c As Integer
Dim yuk As Double, gen As Double
Columns("D").ClearComments
If Intersect(Target, [C4:C1500]) Is Nothing Then Exit Sub
If Target.Count > 5 Then Exit Sub
With Cells(Target.Row, "D")
.AddComment
.Comment.Visible = True
.Comment.Shape.Select True
End With
On Error GoTo yok
'Selection.ShapeRange.Fill.UserPicture "D
Selection.ShapeRange.Fill.UserPicture (ThisWorkbook.Path & "\Poster\" & Cells(Target.Row, "D") & ".jpg") 'Poster Klasörü Excel Dosyası İle Ayni Yerde Olmalı
Selection.Height = 250 'yuk
Selection.Width = 150 'gen
Exit Sub
yok:
Selection.Height = 100 'yuk
Selection.Width = 100 'gen
'Selection.ShapeRange.Fill.UserPicture "D:\Poster\1Hata.jpg"'Poster Klasörü D Sürücüsünde OLmalı
Selection.ShapeRange.Fill.UserPicture (ThisWorkbook.Path & "\Poster\1hata.jpg") 'Poster Klasörü Excel Dosyası İle Ayni Yerde Olmalı
End Sub
