Macro for naming a series in a chart

paul061

New Member
Joined
Aug 29, 2011
Messages
16
Hello, I have a macro for creating a chart. I'd like to have the series names come from a particular cell. I've had some help with some other things like this but can't seem to make them work the same. My programming is zero, so I've been shooting in the dark trying to make this work. This is what I've come up with but it doesn't work. I'd appreciate someone telling me how to make it work and why mine didn't work so I can begin to understand how this all is done. Thak you!

ActiveChart.SeriesCollection(3).Value = Range("B4").Value
 
Try qualifying the range with its worksheet, eg:

Code:
ActiveChart.SeriesCollection(3).Name = Worksheets("Sheet9").Range("B7").Value

If you don't, Excel will use the active sheet, and that may not be a worksheet.
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
That worked!!! Thank you both so much for taking the time to help me. This is my first foray into this type of programming. It's kind of fun and a nice change from my normal mechanical engineering job.

Paul
 
Upvote 0

Forum statistics

Threads
1,225,156
Messages
6,183,244
Members
453,152
Latest member
ChrisMd

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