Sub Sicercle()
[COLOR=Blue] Dim Tsh As String, Rsh As String
Dim Tf, Lf, Wf, Hf, Ti, Li, Rh, Rw As Double
Dim Cel As Range[/COLOR]
Set Cel = ActiveCell
Wi = 11.25 '***Convient à une police 8
Hi = 11.25
[COLOR=DarkGreen] '***Détermine les caractéristiques de la cellule de réception de l'image[/COLOR]
Tf = Cel.Top
Lf = Cel.Left
Wf = Cel.Width
Hf = Cel.Height
Ti = Lf + Wf / 2 - Hi / 2
Li = Tf + Hf / 2 - Wi / 2
[COLOR=DarkGreen]
'***Insère une zone de texte avec un 6[/COLOR]
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, Ti, Li, Wi, Hi).Select
With Selection
.Characters.Text = "6"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
Tsh = Selection.Name
With Selection.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 8
End With
With Selection.ShapeRange
.Fill.ForeColor.SchemeColor = 65
.Fill.Transparency = 1#
.Line.Transparency = 1#
.Line.Visible = msoFalse
End With
[COLOR=DarkGreen] '***Insère un rond[/COLOR]
ActiveSheet.Shapes.AddShape(msoShapeOval, Ti, Li, Wi, Hi).Select
Rsh = Selection.Name
With Selection.ShapeRange
.Fill.Transparency = 1#
.Line.Visible = msoTrue
.Line.ForeColor.SchemeColor = 10
.Line.BackColor.RGB = RGB(255, 255, 255) '***ligne en rouge
End With
[COLOR=DarkGreen] '***Aligne les deux formes (Normalement superfétatoire)[/COLOR]
ActiveSheet.Shapes.Range(Array(Tsh, Rsh)).Select
Selection.ShapeRange.Align msoAlignMiddles, False
Selection.ShapeRange.Align msoAlignCenters, False
End Sub