Runtime error on Macro

mark91345

Board Regular
Joined
Feb 11, 2011
Messages
113
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
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Code:
ActiveSheet.ChartObjects(1).Activate[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,855
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top