Re : Marquer des cellules déterminées
Salut,
Une petite macro à appeler après avoir selectionné les cellules à cocher.
Sub CoinBleu()
' Macro crée le 28/01/2008 par Celeborn !
Taille = 5 ' Tu peux changer la taille du triangle ici
For Each Cel In Selection.Cells
X = Cel.Left
Y = Cel.Top
Nom = "NomTriangleBleu_" & Cel.Row & "_" & Cel.Column
On Error GoTo NexistePas
' Désolé pour la gestion, mais pas le temps de trouver plus élégant. ;-)
A = ActiveSheet.Shapes(Nom)
GoTo Existe
NexistePas:
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, X, Y)
.AddNodes msoSegmentLine, msoEditingAuto, X, Y + Taille
.AddNodes msoSegmentLine, msoEditingAuto, X + Taille, Y
.AddNodes msoSegmentLine, msoEditingAuto, X, Y
.ConvertToShape.Name = Nom
End With
With ActiveSheet.Shapes(Nom)
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.SchemeColor = 12
.Fill.Transparency = 0#
.Line.Weight = 0.75
.Line.DashStyle = msoLineSolid
.Line.Style = msoLineSingle
.Line.Transparency = 0#
.Line.Visible = msoTrue
.Line.ForeColor.SchemeColor = 12
.Line.BackColor.RGB = RGB(255, 255, 255)
End With
Existe:
On Error GoTo 0
Next Cel
End Sub