1 pièce(s) jointe(s)
Ecrire dans une text Box avec une mouseMove
Bonjour,
j'ai créé une textbox dans un graphique, une textbox qui s'affiche lorsque je passe sur un de mes points de mon nuage de points. Mon soucis est de réussir à faire un retour à la ligne. En effet quand j'utilise Vbclrf dans la macro il me fait bien un retour à la ligne mais me rajoute un carré...je n'arrive pas à trouver s'il sagit dun problème de format ou autre ???
Le projet est joint
Important, toutes les données sont dynamiques et la propriété Multiline est déjà activée. J'ai essayé avec une méthode bourrin en rajoutant plein de " " mais ça me créé d'autre soucis.
Merci d'avance
Code:
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
| Private Sub chart_MouseMove(ByVal Button As Long, ByVal Shift As Long, _
ByVal x As Long, ByVal y As Long)
Dim ElementID As Long
Dim Arg1 As Long, Arg2 As Long
Dim c As Long
Dim r As Long
c = Range("Graphe").Column
r = Range("Graphe").Row
On Error Resume Next
ActiveChart.GetChartElement x, y, ElementID, Arg1, Arg2
ActiveChart.Shapes("Text Box 1").Visible = msoFalse
If (Arg1 = 1 And ElementID <> 15 And ElementID <> 21) Then
If Arg2 = 0 Then
ActiveChart.Shapes("Text Box 1").Visible = msoFalse
Else
With ActiveChart.Shapes("Text Box 1")
.MultiLine = True
.Visible = msoTrue
.TextFrame.Characters.Text = _
Range("Graphe").Offset(Arg2, 0) & "" _
& " " & Worksheets("Plot").Cells(r, c + 4) & " : " & Format(Range("Graphe").Offset(Arg2, 4), "0.0000x") & "" _
& " " & Worksheets("Plot").Cells(r, c + 3) & " : " & Format(Range("Graphe").Offset(Arg2, 3), "0.0000x") & "" _
& " " & "Quintile : " & Range("Graphe").Offset(Arg2, 1) & "" _
& " " & "Percentile : " & Range("Graphe").Offset(Arg2, 1)
End With
End If
End If
End Sub |