How to display just first and last values on axis?

rmgarrett

New Member
Joined
Mar 30, 2009
Messages
14
Greetings,

I'm trying to condense some charts, and I'd like to show just the first/last (beginning/ending) axis labels, not the values at each tick mark. For instance, if my axis now reads 0, 5, 10, 15, 20, 25, I want it to just have 0, 25 (keeping the tick marks).

Can anyone tell me a way to do this?

Thanks in advance for the help!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi,

I wrote this a while back to just show the first and last data labels on a set of line graphs that plotted monthly values.

Maybe you can adapt it to your purpose:

Code:
Dim myCount, myCount2 As Integer
Dim myChart As ChartObject

For Each myChart In ActiveSheet.ChartObjects
    
    myChart.Chart.ApplyDataLabels ShowValue:=False
    
    For myCount = 1 To myChart.Chart.SeriesCollection.Count
                    
        ' determine last point in series based on month being run
        myCount2 = Range("Month").Value
    
        myChart.Chart.SeriesCollection(myCount).Points(1).ApplyDataLabels ShowValue:=True
        myChart.Chart.SeriesCollection(myCount).Points(myCount2).ApplyDataLabels ShowValue:=True
      
        myChart.Chart.SeriesCollection(myCount).DataLabels.Font.Size = 8

    Next myCount
      
Next myChart


Dom
 
Upvote 0
Domski, thank you for posting this.

What I ended up doing was modifying the axis interval. So if I wanted just "2004" and "2008" to display, I set the label interval to 4.

I am sure your way is better if I had a large number of graphs to do this to.

Again, thanks!


--Rachel
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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