I don't know what I'm doing wrong.
I created a macro to make a "radar chart" for my spreadsheet; however, when I run it, I get a runtime error ("the item with the specified name wasn't found.")
I never named my chart or my worksheet, so nothing was changed there. Below is my macro with the error highlighted.
Thanks,
Mark
' Radar Macro
'
' Keyboard Shortcut: Ctrl+r
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlRadar
ActiveChart.SetSourceData Source:=Range("Sheet1!$A$1:$C$505")
ActiveChart.Legend.Select
Selection.Delete
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveSheet.Shapes("Chart 1").LockAspectRatio = msoTrue
ActiveSheet.Shapes("Chart 1").Width = 720
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
Selection.Format.Line.Visible = msoFalse
ActiveChart.Axes(xlValue).MinimumScale = 0
ActiveChart.Axes(xlValue).MaximumScale = 6
ActiveChart.Axes(xlValue).MajorUnit = 1
End Sub
I created a macro to make a "radar chart" for my spreadsheet; however, when I run it, I get a runtime error ("the item with the specified name wasn't found.")
I never named my chart or my worksheet, so nothing was changed there. Below is my macro with the error highlighted.
Thanks,
Mark
' Radar Macro
'
' Keyboard Shortcut: Ctrl+r
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlRadar
ActiveChart.SetSourceData Source:=Range("Sheet1!$A$1:$C$505")
ActiveChart.Legend.Select
Selection.Delete
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveSheet.Shapes("Chart 1").LockAspectRatio = msoTrue
ActiveSheet.Shapes("Chart 1").Width = 720
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
Selection.Format.Line.Visible = msoFalse
ActiveChart.Axes(xlValue).MinimumScale = 0
ActiveChart.Axes(xlValue).MaximumScale = 6
ActiveChart.Axes(xlValue).MajorUnit = 1
End Sub