Series Chart and Its Data

AndyVoClosser

New Member
Joined
Oct 30, 2023
Messages
9
Office Version
  1. 365
Platform
  1. 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
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top