1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Option Explicit
Public WithEvents Graph1 As Chart
Private Sub Graph1_MouseMove(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long)
Dim ElementID As Long, SeriesIndex As Long, PointIndex As Long
Dim S As Series, H As Integer, j As Integer, Form As String
Dim CellX As Range, CellY As Range
Graph1.GetChartElement x, y, ElementID, SeriesIndex, PointIndex
If ElementID = xlSeries Then
Form = Graph1.SeriesCollection(SeriesIndex).Formula
H = InStr(1, Form, ",") + 1
j = InStr(H, Form, ",") + 1
Set CellX = Range(Mid$(Form, H, j - H - 1))(PointIndex)
Set CellY = Range(Mid$(Form, j, InStr(j, Form, ",") - j))(PointIndex)
Application.StatusBar = "REPORT = " & CellX(1, 4) & " ARTICLE = " & CellX(1, 5) & " LENGTH = " & CellX(1, 21).Value & " | "
Else: Application.StatusBar = False
End If
End Sub |
Partager