Hi
VBA
On a selected point in chart want to put the number only in to a variable.
activepoint.number.? into variable called say pLog
Is there such a thing as an activepoint? Need number only for ID
Thanks
Hi
VBA
On a selected point in chart want to put the number only in to a variable.
activepoint.number.? into variable called say pLog
Is there such a thing as an activepoint? Need number only for ID
Thanks
Yes, sort of:Sub blah() 'ActiveSheet.ChartObjects("Chart 1").Chart.FullSeriesCollection(1).Points(2).Select 'the above line not needed if you have already selected the point using the mouse. Set myPoint = Selection 'this will be a single point. 'Because Help says:"The name is represented using the following format: S< series number >P< point number >" you should be able to get the index: PointIndex = CLng(Split(myPoint.Name, "P")(1)) Set mySeries = myPoint.Parent 'this will be a single series on the chart. Set myPoints = mySeries.Points 'this will be a collection of points 'you can now refer to that point either as myPoints(PointIndex): Set a = myPoints(PointIndex) 'or as mySeries.points(PointIndex): Set b = mySeries.Points(PointIndex) End Sub
Last edited by p45cal; 04-02-2018 at 02:50 AM.
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.