tahsinanarat
Altın Üye
- Katılım
- 14 Mart 2005
- Mesajlar
- 2,181
- Excel Vers. ve Dili
- Ofis 2019 Türkçe
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A2:J65536]) Is Nothing Then Exit Sub
If Target.Row Mod 43 = 0 Then Exit Sub
On Error GoTo Hata
For i = 1 To Sheets("TABLO").Shapes.Count
If Sheets("TABLO").Shapes(i).Left = Target.Offset(-1, 0).Left _
And Sheets("TABLO").Shapes(i).Top = Target.Offset(-1, 0).Top Then
Sheets("TABLO").Shapes(i).Delete
End If
Next i
Hata:
On Error GoTo son
Sheets("TABLO").Pictures.Insert("D:\A Grubu Personel resimleri\" & Target.Value & ".jpg").Select
Selection.Top = Target.Offset(-1, 0).Top
Selection.Left = Target.Offset(-1, 0).Left
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.IncrementLeft 3 'Sağa kaydır
Selection.ShapeRange.IncrementTop 2.25 'aşağıya kaydır
'Selection.ShapeRange.Height = Target.Offset(-1, 0).Height
'Selection.ShapeRange.Width = Target.Offset(-1, 0).Width
Selection.ShapeRange.Height = 109
Selection.ShapeRange.Width = 94
'Target.Select
son:
End Sub
Yukarıdaki kod ile hücreye isim yazınca dosya yolundaki resimlerden eşleşenler bir üst hücreye getirebiliyoruz, eğer aranan resim yok ise Resim_yok.jpg adlı resmin gelmesi için kodda nasıl bir değişiklik yapmalıyız.
Yardımlarınız için şimdiden teşekkür ederim. Tahsin.
If Intersect(Target, [A2:J65536]) Is Nothing Then Exit Sub
If Target.Row Mod 43 = 0 Then Exit Sub
On Error GoTo Hata
For i = 1 To Sheets("TABLO").Shapes.Count
If Sheets("TABLO").Shapes(i).Left = Target.Offset(-1, 0).Left _
And Sheets("TABLO").Shapes(i).Top = Target.Offset(-1, 0).Top Then
Sheets("TABLO").Shapes(i).Delete
End If
Next i
Hata:
On Error GoTo son
Sheets("TABLO").Pictures.Insert("D:\A Grubu Personel resimleri\" & Target.Value & ".jpg").Select
Selection.Top = Target.Offset(-1, 0).Top
Selection.Left = Target.Offset(-1, 0).Left
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.IncrementLeft 3 'Sağa kaydır
Selection.ShapeRange.IncrementTop 2.25 'aşağıya kaydır
'Selection.ShapeRange.Height = Target.Offset(-1, 0).Height
'Selection.ShapeRange.Width = Target.Offset(-1, 0).Width
Selection.ShapeRange.Height = 109
Selection.ShapeRange.Width = 94
'Target.Select
son:
End Sub
Yukarıdaki kod ile hücreye isim yazınca dosya yolundaki resimlerden eşleşenler bir üst hücreye getirebiliyoruz, eğer aranan resim yok ise Resim_yok.jpg adlı resmin gelmesi için kodda nasıl bir değişiklik yapmalıyız.
Yardımlarınız için şimdiden teşekkür ederim. Tahsin.
