I want to create a chart that has 2 bars and a line (for a reference line) and I want to record a macro to do it (because I will need to do it for many different spreadsheets). I am very new at doing macros in excel- I mainly work in SAS. The error is in the first selection.MajorTickMark statement-I get a runtime error 438:
Sub Macro4()
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue, xlSecondary).Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = 0.9
ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = 1
Selection.MajorTickMark = xlNone
Selection.TickLabelPosition = xlNone
End Sub