- Katılım
- 13 Şubat 2020
- Mesajlar
- 31
- Excel Vers. ve Dili
- 2019
Selamlar,
Arkadaşlar böyle bir makro var halihazırda. İstediğimiz şey sadece bu makro çalışmadan önce sayfadaki b7:c1000 aralığındaki resimleri temizlesin. Umarım mümkündür.
Çünkü her resimleri getirdiğinde resimleri üst üste yazıyor...
Sub resim_getir()
Application.ScreenUpdating = False
On Error Resume Next
Set s1 = Sheets("Res")
Set s2 = Sheets("Proforma")
Set Alan = Range("b7:c1000")
For Each resimm In ActiveSheet.Pictures
If Not Intersect(resimm.TopLeftCell, Alan) Is Nothing Then
resimm.Delete
End If
Next
Set Alan = Nothing
For i = 7 To s2.Range("e65536").End(xlUp).Row
If s2.Cells(i, "d") = "" Then Exit For
aranan = s2.Cells(i, "d").Value
Dim Picture As Object
sat1 = i
sat2 = i
sut1 = "B"
sut2 = "C"
Set Adres = Range(Cells(sat1, sut1).Address, Cells(sat2, sut2).Address)
For Each Picture In s1.Shapes
If TypeName(s1.Shapes(Picture.Name).OLEFormat.Object) = "Picture" Then
satir = Picture.BottomRightCell.Row
bulunan = s1.Cells(satir, 3).Value
If aranan = bulunan Then
s1.Shapes(Picture.Name).Select
s1.Shapes(Picture.Name).CopyPicture
Range("B" & i).Select
ActiveSheet.Paste
Selection.Top = Cells(sat1, "b").Top
Selection.Left = Cells(sat1, "b").Left
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Range(Cells(sat1, sut1), Cells(sat2, sut2)).Height
Selection.ShapeRange.Width = Range(Cells(sat1, sut1), Cells(sat2, sut2)).Width
End If
End If
Next Picture
Application.CutCopyMode = False
Range("d" & i).Select
Next i
Application.ScreenUpdating = True
End Sub
Arkadaşlar böyle bir makro var halihazırda. İstediğimiz şey sadece bu makro çalışmadan önce sayfadaki b7:c1000 aralığındaki resimleri temizlesin. Umarım mümkündür.
Çünkü her resimleri getirdiğinde resimleri üst üste yazıyor...
Sub resim_getir()
Application.ScreenUpdating = False
On Error Resume Next
Set s1 = Sheets("Res")
Set s2 = Sheets("Proforma")
Set Alan = Range("b7:c1000")
For Each resimm In ActiveSheet.Pictures
If Not Intersect(resimm.TopLeftCell, Alan) Is Nothing Then
resimm.Delete
End If
Next
Set Alan = Nothing
For i = 7 To s2.Range("e65536").End(xlUp).Row
If s2.Cells(i, "d") = "" Then Exit For
aranan = s2.Cells(i, "d").Value
Dim Picture As Object
sat1 = i
sat2 = i
sut1 = "B"
sut2 = "C"
Set Adres = Range(Cells(sat1, sut1).Address, Cells(sat2, sut2).Address)
For Each Picture In s1.Shapes
If TypeName(s1.Shapes(Picture.Name).OLEFormat.Object) = "Picture" Then
satir = Picture.BottomRightCell.Row
bulunan = s1.Cells(satir, 3).Value
If aranan = bulunan Then
s1.Shapes(Picture.Name).Select
s1.Shapes(Picture.Name).CopyPicture
Range("B" & i).Select
ActiveSheet.Paste
Selection.Top = Cells(sat1, "b").Top
Selection.Left = Cells(sat1, "b").Left
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Range(Cells(sat1, sut1), Cells(sat2, sut2)).Height
Selection.ShapeRange.Width = Range(Cells(sat1, sut1), Cells(sat2, sut2)).Width
End If
End If
Next Picture
Application.CutCopyMode = False
Range("d" & i).Select
Next i
Application.ScreenUpdating = True
End Sub
