Macro Recorder doesn't record Design/Select Data

VBAProIWish

Well-known Member
Joined
Jul 6, 2009
Messages
1,027
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I used the macro recorder to record the following...(recorded code below)

1. Select a chart
2. Select "Design" in the ribbon
3. Select "Select Data"
4. Select my desired data range
5. Press ok
6. Insert a template

However, the only part that's recorded is selecting the chart and inserting a template.
The recorder completely ignored steps 2-5.
Does anyone know why?

VBA Code:
   Sheets("Slide 1").Select
    ActiveSheet.ChartObjects("Chart 1").Activate
    Application.CutCopyMode = False
    ActiveChart.ApplyChartTemplate ("C:\Charts\_Slide 1.crtx")

Thanks much
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi
Please try adding the below
Code:
ActiveSheet.ChartObjects("Chart 1").SetSourceData Source:=Sheets(1).Range("A1:A10"), PlotBy:=xlColumns

Also, its a good idea to learn how to code explicitly as the code created by the recorder can have undesired consequenses

 
Upvote 0
Solution

Forum statistics

Threads
1,215,781
Messages
6,126,870
Members
449,345
Latest member
CharlieDP

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