Sub AKTAR()
Set s1 = Sheets("DATA")
Set s2 = Sheets("FORM")
aranan = s2.Cells(8, "d").Value
Dim Picture As Object
'On Error Resume Next
sat1 = 7
sat2 = 7
sut1 = "f"
sut2 = "f"
Set Adres = Range(Cells(sat1, sut1), Cells(sat2, sut2))
For Each Picture In ActiveSheet.Shapes
If Not Intersect(Range(Picture.TopLeftCell.Address & ":" & Picture.BottomRightCell.Address), Adres) Is Nothing Then
'If Adres.Address = Picture.TopLeftCell.Address & ":" & Picture.BottomRightCell.Address Then
Picture.Delete
Exit For
End If
Next Picture
For Each Picture In s1.Shapes
If TypeName(s1.Shapes(Picture.Name).OLEFormat.Object) = "Picture" Then
satir = Picture.BottomRightCell.Row
bulunan = s1.Cells(satir, 1).Value
If aranan = bulunan Then
s1.Shapes(Picture.Name).Select
s1.Shapes(Picture.Name).CopyPicture
Range("f7").Select
ActiveSheet.Paste
Selection.Top = Adres.Top + 3
Selection.Left = Adres.Left + 3
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Adres.Height - 4
Selection.ShapeRange.Width = Adres.Width - 4
End If
End If
Next Picture
Application.CutCopyMode = False
Range("d8").Select
End Sub
Arkadaslar yukarıda yazdıgım kod ıle sayfa 2 den yanı 'DATA' dan resmi alarak sayfa1 e yanı 'FORM'a değere bağlı olarak getirebiliyorum... Benim öğrenmek istediğim sayfa 2 den yanı 'DATA' dan degilde mesela https://örnek/Proje/123.jpg gibi adresten resim almak istersem yukarıda yazmıs oldugum kodu nasıl değistirmeliyim...
Kısaca
( FORM sayfasında d8 'e 123 yazdıgımda adresten 123 resmını alarak yıne FORM sayfasında F7 ye yerlestırsın ).... Yardımı olacak herkese tesekkürler....
Set s1 = Sheets("DATA")
Set s2 = Sheets("FORM")
aranan = s2.Cells(8, "d").Value
Dim Picture As Object
'On Error Resume Next
sat1 = 7
sat2 = 7
sut1 = "f"
sut2 = "f"
Set Adres = Range(Cells(sat1, sut1), Cells(sat2, sut2))
For Each Picture In ActiveSheet.Shapes
If Not Intersect(Range(Picture.TopLeftCell.Address & ":" & Picture.BottomRightCell.Address), Adres) Is Nothing Then
'If Adres.Address = Picture.TopLeftCell.Address & ":" & Picture.BottomRightCell.Address Then
Picture.Delete
Exit For
End If
Next Picture
For Each Picture In s1.Shapes
If TypeName(s1.Shapes(Picture.Name).OLEFormat.Object) = "Picture" Then
satir = Picture.BottomRightCell.Row
bulunan = s1.Cells(satir, 1).Value
If aranan = bulunan Then
s1.Shapes(Picture.Name).Select
s1.Shapes(Picture.Name).CopyPicture
Range("f7").Select
ActiveSheet.Paste
Selection.Top = Adres.Top + 3
Selection.Left = Adres.Left + 3
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Adres.Height - 4
Selection.ShapeRange.Width = Adres.Width - 4
End If
End If
Next Picture
Application.CutCopyMode = False
Range("d8").Select
End Sub
Arkadaslar yukarıda yazdıgım kod ıle sayfa 2 den yanı 'DATA' dan resmi alarak sayfa1 e yanı 'FORM'a değere bağlı olarak getirebiliyorum... Benim öğrenmek istediğim sayfa 2 den yanı 'DATA' dan degilde mesela https://örnek/Proje/123.jpg gibi adresten resim almak istersem yukarıda yazmıs oldugum kodu nasıl değistirmeliyim...
Kısaca
( FORM sayfasında d8 'e 123 yazdıgımda adresten 123 resmını alarak yıne FORM sayfasında F7 ye yerlestırsın ).... Yardımı olacak herkese tesekkürler....
