Any Help with Intersect and trim. I'm stuck!!!

I would like to do these steps using code but I'm getting stuck on the intersect and trim portion
1. User selects 3 overlapping shapes and I want to intersect the front and back objects then delete the front (I know you have to change to false)
2. The final 2 shapes are trimmed with the shape in the front being delete.
Let me know if this is something you can do!!
Im stuck!!
    Dim s As Shape, sr As ShapeRange
    Dim zPlace As String, i As Long
    
    Set sr = ActiveSelectionRange
 
// I only used for loop to see if I could determine the order
  
    For i = 1 To sr.Count
        Set s = sr(i)
        zPlace = zPlace & " " & s.ZOrder 
    Next i
       
            MsgBox zPlace
        
       
   ' Set s = s2(s2ID).Intersect(s1(s1ID), False, True)
    
Parents
No Data
Reply
  •  

    Sub test()
     Dim sr As ShapeRange, s1 As Shape, s2 As Shape
        Set sr = ActiveSelectionRange
        If sr.Count <> 3 Then MsgBox "3 shapes must be selected": Exit Sub
        Set s1 = sr(3).Intersect(sr(1), False, True)
        Set s2 = sr(2).Intersect(sr(1), False, True)
    End Sub

    EDIT: sorry 2nd step should be TRIM

    Sub test()
     Dim sr As ShapeRange, s1 As Shape, s2 As Shape
        Set sr = ActiveSelectionRange
        If sr.Count <> 3 Then MsgBox "3 shapes must be selected": Exit Sub
        Set s1 = sr(3).Intersect(sr(1), False, True)
        Set s2 = sr(2).Trim(sr(1), False, True)
    End Sub

Children