A question about formatting a chart, VBA, Chapter 15, Page 316

Virgin

New Member
Joined
Jan 13, 2016
Messages
30
I tried changing the interior color of the following chart:
Workbook: "ProjectFilesChapter15-FirstChart.xlsm"
Worksheet: "Sheet1"

I used the following line:
Workbooks("ProjectFilesChapter15-FirstChart.xlsm").Activate
Worksheets("Sheet1").Shapes("Chart 2").Chart.Interior.Color = RGB(0,255,0)

I receive Run Tim Error 438

Thank you!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
A chart doesn't have an Interior property. It should be:
Rich (BB code):
Worksheets("Sheet1").Shapes("Chart 2").Chart.ChartArea.Interior.Color = RGB(0,255,0)
if you are trying to change the chart background colour, or use PlotArea if you only want the plot area.
 

Forum statistics

Threads
1,214,606
Messages
6,120,479
Members
448,967
Latest member
visheshkotha

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