1

I would like to offset the tickmarks of a secondary axis in excel WITHOUT changing the minimum. Here is a very complicated VBA class that apparently solves the issue but I would like a solution that doesn't require me to construct my entire chart in VBA.

Here is an example of what I mean (I removed the chart insides so it looks funny, but really only the axes matter for this question):

enter image description here

I am happy with the primary axis on the left. The secondary axis is just the primary axis plus 7.96%, so the secondary axis HAS TO have 0.0796 as a minimum. But I would like my tickmarks to be at nice rounder numbers so I would like to offset the starting point of the secondary axis' tickmarks to only start at 8%.

Does anyone know of a way to achieve this? Just to be clear about the VBA, I am happy to use a VBA solution but I don't have the time to actually construct the chart itself in VBA. Using VBA to get a handle on the chart and make the adjustment would be perfect.

1 Answer 1

3

OK, Thanks to this excellent article by Jon Peltier, I managed to figure out a hack for this:

I made a dummy series with X values all equal to my chart's X maximum and with Y values equal to the values I wanted to show (i.e. 0.08, 0.0825, 0,085...) and then just formatted it to have lines for markers and no line joining them, added data labels. And then hid my actual axis (this was also a hack, I made the number format ".", made the font colour white and the major step larger than the Y max).

This is the result - the secondary axis now still does start at 7.96% but I have managed to precisely offset the tickmarks so that they start at 8%.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .