I am attempting to use the cobbled code below to determine the current axis of a chart series, and then set a cell value to true of false based on that information. When I execute the code I get a runtime error |Unable to get the ChartObjects property of the worksheet class. Can someone point out the error of my ways?
Regards...Strorg
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Select
CurrentAxis = ActiveChart.SeriesCollection(1).AxisGroup
Application.Goto Reference:="ap1a"
If CurrentAxis = 1 Then
ActiveCell.Value = True
Else: ActiveCell.Value = False
End If
Regards...Strorg
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Select
CurrentAxis = ActiveChart.SeriesCollection(1).AxisGroup
Application.Goto Reference:="ap1a"
If CurrentAxis = 1 Then
ActiveCell.Value = True
Else: ActiveCell.Value = False
End If