Copy all formats of pciture to another picture

YasserKhalil
PlatinumLounger
Posts: 4930
Joined: 31 Aug 2016, 09:02

Copy all formats of pciture to another picture

Post by YasserKhalil »

Hello everyone
I have two pictures `LoginSchool` and `MyPic` and I need to copy all the formats applied on `LoginSchool` to the `myPic`. This is the basic code

Code: Select all

Sub FormatPicture()
    Dim ws As Worksheet, picLoginSchool As Picture, picMyPic As Picture, t As Double, l As Double, w As Double, h As Double
    Set ws = ThisWorkbook.Sheets(1)
    Set picLoginSchool = ws.Pictures("LoginSchool")
    Set picMyPic = ws.Pictures("MyPic")
    With picLoginSchool
        t = .Top
        l = .Left
        w = .Width
        h = .Height
    End With
    With picMyPic
        .Top = t
        .Left = l
        .Width = w
        .Height = h
    End With
End Sub
I would like to apply the same borders colors of the borders the weight of the borders, any shadows applied. All possible formats.