Sub DrapeauEcossais(cel As Range, couleur As Range)
Dim x, y, w, h, e
With cel
x = .Left: y = .Top
w = .Width: h = .Height
e = Application.Min(w, h) / 8 'coefficient à adapter
End With
ActiveSheet.DrawingObjects.Delete
ActiveSheet.Shapes.AddShape(msoShapeIsoscelesTriangle, x + e, y + h / 2 + e, w - 2 * e, h / 2 - e) _
.Fill.ForeColor.RGB = couleur.Interior.Color
With ActiveSheet.Shapes.AddShape(msoShapeIsoscelesTriangle, x + e, y, w - 2 * e, h / 2 - e)
.Rotation = 180
.Fill.ForeColor.RGB = couleur.Interior.Color
End With
With ActiveSheet.Shapes.AddShape(msoShapeIsoscelesTriangle, 0, 0, 0, 0)
.Rotation = 90
.Left = x + w / 2 - e: .Top = y + e
.Width = h - 2 * e: .Height = w / 2 - e
.Fill.ForeColor.RGB = couleur.Interior.Color
End With
With ActiveSheet.Shapes.AddShape(msoShapeIsoscelesTriangle, 0, 0, 0, 0)
.Rotation = -90
.Left = x + w / 2 + e: .Top = y + h - e
.Width = h - 2 * e: .Height = w / 2 - e
.Fill.ForeColor.RGB = couleur.Interior.Color
End With
End Sub