Bonjour

J'ai un petit problème. J'ai fait la création de 2 shapes en y appliquant une macro. Un texte est centré dans la shape.

Lorsque j'exécute la macro. Le texte ce centre dans la feuille "Janvier". Par contre dans les autres feuilles qui suivent, le texte se place en haut de la shape.

Voici mon code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Sub CreationBouton()
 
 
'Création bouton Janvier AGT
 
 
    With Worksheets("Janvier").Shapes.AddShape(msoShapeRectangle, 100, 450, 175, 75)
 
With .TextFrame.Characters
.Text = "Agent statistique terminée"
With .Font
.Name = "Calibri"
.Size = 12
.Bold = True
.ColorIndex = 1
End With
End With
.Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = xlHorizontal
End With
 
 
.OnAction = "Feuil9.Termine_agent_Janvier"
End With
 
 
 
'Création bouton Janvier SGT
With Worksheets("Janvier").Shapes.AddShape(msoShapeRectangle, 775, 450, 175, 75)
 
With .TextFrame.Characters
.Text = "Sergent statistique compilée"
With .Font
.Name = "Calibri"
.Size = 12
.Bold = True
.ColorIndex = 1
End With
End With
.Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = xlHorizontal
End With
 .OnAction = "Feuil9.Compil_sergent_Janvier"
End With
 
 
 
 
'Création bouton Fevrier AGT
    With Worksheets("Fevrier").Shapes.AddShape(msoShapeRectangle, 100, 450, 175, 75)
 
With .TextFrame.Characters
.Text = "Agent statistique terminée"
With .Font
.Name = "Calibri"
.Size = 12
.Bold = True
.ColorIndex = 1
End With
End With
.Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = xlHorizontal
End With
.OnAction = "Feuil7.Termine_agent_Fevrier"
End With
 
 
'Création bouton Fevrier SGT
With Worksheets("Fevrier").Shapes.AddShape(msoShapeRectangle, 775, 450, 175, 75)
 
With .TextFrame.Characters
.Text = "Sergent statistique compilée"
With .Font
.Name = "Calibri"
.Size = 12
.Bold = True
.ColorIndex = 1
End With
End With
.Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = xlHorizontal
End With
.OnAction = "Feuil7.Compil_sergent_Fevrier"
End With
 
End Sub
Je ne comprend pas ce qui se passe !!!!

Merci de votre aide