VBA - How to: ID a chart element by it's XValue (name)

Chris The Rock

Active Member
Joined
Feb 24, 2002
Messages
287
This will be difficult to ask correctly, but I'll try.

I'm creating charts with code, adding one data series at a time. I've successfully done this.

In some of my charts, the data series include 13 points of data, made up of 12 months and YTD figures.

The request has come to me that the recipients want to see the YTD figures in the chart's Data Table, but not on the chart. I understand that normally this is not possible, but I've figured out a trick. I just need to remove the background and fill color for the YTD data point by setting it to "none".

Since I have to do this automatically, I need to program my code to find the YTD data point within the chart series. My problem is, I don't know which property of which object to reference to get the name of the data point. I know that the name "YTD" is the XValues range, but I can't seem to isolate it.

What I need to learn to do is search series for a "YTD" data point, and perform the desired actions if I find it.

Anyone out there know what I'm talking about?

Thanks in advance for any help.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,141,587
Messages
5,707,242
Members
421,498
Latest member
matinebi

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
Top