Display Data Labels for only the First and Last Data Points

3link

Board Regular
Joined
Oct 15, 2010
Messages
138
My graph looks like this:
beforecg.png

Basically, I want to get rid of the center labels for the red and blue lines (series). This is a dynamic graph and the value will vary by user input. Thus, I can't simply delete these labels and fix the problem. I need to set-up excel so that only the first and last values of the two series have labels. The end result would look like:

afterez.png



Is this possible? A VBA solution would be great. Thank you.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
The routine in this article finds the last label-able point in each series of a chart. You could modify it to also label the first point of each series.

http://peltiertech.com/WordPress/label-last-point-for-excel-2007/
Thank you for this. :)

I'm having trouble modifying it to include both first and last. I'm able to change it between first and last by changing the value of the negative number that comes after "Step", but that's it thus far. This will be a learning experience.
 
Upvote 0
Only loop once. In my situation, it is the last point which is hardest to identify, so looping from the last forward made the most sense. After the loop labels the last point, explicitly label the first.
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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