|
楼主 |
发表于 2024-10-18 16:20
|
显示全部楼层
本帖最后由 seduse 于 2024-10-18 18:22 编辑
问题2,我看到了这个教程,但是操作以后不成功,不知道是不是代码有误,还是哪里设置不对!
教程链接:23鼠标悬停二-鼠标滑过折线图,就能立刻显示数据.mp4_哔哩哔哩_bilibili
VBA代码如下:
Public WithEvents mychartClass As Chart
Private Sub myChartClass_Mousemove(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long)
Dim lElementID As Long
Dim lAFg1 As Long
Dim lArg2 As Long
mychartClass.GetChartElement x, y, lElementID, lArg1, lArg2
If lElementID = xlSeries Then
[cur_series] = lArg1 '记录序列id
[cur_point] = lArg2 '记录数据点id
End If
End Sub
|
|