AndyVoClosser
New Member
- Joined
- Oct 30, 2023
- Messages
- 9
- Office Version
- 365
- Platform
- Windows
Hi all,
I need your help for my issue as follow: I have a series chart with 5 points. I want that If I select points(1), it will show me the data of points(1), when I select points(2), it will show me the data of points(2)..., so on, until points(5). Below is my code, but I does not work. Please give me your advices, thank you so much.
Sub ShowDataChart1()
Dim cht As Chart
Dim sr As Series
Dim nPts As Points
Dim nPoints As Integer
Set cht = ActiveSheet.ChartObjects("Chart 1").Chart
Set sr = cht.SeriesCollection(1)
Set nPts = sr.Points(nPoints)
If ActiveChart.FullSeriesCollection(1).Points(1).Select Then
Sheets("Data (4)").Select
Range("D6:D8").Select
ElseIf ActiveChart.FullSeriesCollection(1).Points(2).Select Then
Sheets("Data (4)").Select
Range("D24:D26").Select
End If
End Sub
I need your help for my issue as follow: I have a series chart with 5 points. I want that If I select points(1), it will show me the data of points(1), when I select points(2), it will show me the data of points(2)..., so on, until points(5). Below is my code, but I does not work. Please give me your advices, thank you so much.
Sub ShowDataChart1()
Dim cht As Chart
Dim sr As Series
Dim nPts As Points
Dim nPoints As Integer
Set cht = ActiveSheet.ChartObjects("Chart 1").Chart
Set sr = cht.SeriesCollection(1)
Set nPts = sr.Points(nPoints)
If ActiveChart.FullSeriesCollection(1).Points(1).Select Then
Sheets("Data (4)").Select
Range("D6:D8").Select
ElseIf ActiveChart.FullSeriesCollection(1).Points(2).Select Then
Sheets("Data (4)").Select
Range("D24:D26").Select
End If
End Sub