My goal is to readjust my chart for specific viewing. I want to select a particular point, then press a macro button, and, by having the index number of that point, I can adjust the relevant scrollers (I have one for position, and one for "compression"), so that I can see an expanded view of the area of the chart that contains the point I selected.
I simply need to assign the selected point's index number to a variable.
Here's a macro I recorded of selecting the point:
Sub Macro1()
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(7).Points(4176).Select
ActiveSheet.ChartObjects("Chart 1").Activate
End Sub
So, to try a test I wrote the following macro--which tells me "the object isn't supported" (or something like that). (Note, I put "Stop" so that I can just see if my variable has caught the value. So, I select the point, press the macro button, and I get the error):
Sub MacroTest()
Dim IsIndex As Integer
With Selection
IsIndex = .Index
Stop
End With
End Sub
I simply don't know how to ask for the point index number.
Appreciate any help!
Thanks!
I simply need to assign the selected point's index number to a variable.
Here's a macro I recorded of selecting the point:
Sub Macro1()
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(7).Points(4176).Select
ActiveSheet.ChartObjects("Chart 1").Activate
End Sub
So, to try a test I wrote the following macro--which tells me "the object isn't supported" (or something like that). (Note, I put "Stop" so that I can just see if my variable has caught the value. So, I select the point, press the macro button, and I get the error):
Sub MacroTest()
Dim IsIndex As Integer
With Selection
IsIndex = .Index
Stop
End With
End Sub
I simply don't know how to ask for the point index number.
Appreciate any help!
Thanks!