Avatar of mss72
mss72
 asked on

Excel 2003 VBA How do I make TickLabelSpacing automatic?

I am using Excel 2003 and wish to make the spacing of the category labels on the Category (x) axis automatic, using VBA. Using TickLabelSpacing requires a number between 1 and 31999 and does not accommodate xlAutomatic.
Microsoft Excel

Avatar of undefined
Last Comment
mss72

8/22/2022 - Mon
Rory Archibald

There is no option for automatic. The closest thing to it is to not specify a value and let Excel default to a value.
mss72

ASKER
The problem is that Excel normally does set the TickLabelSpacing automatically in a new chart but once the spacing is set to a specific value you cannot return to the automatic mode. Setting TickLabelSpacing to Null seems to have no effect. Setting the value to 0, Empty, Nothing or "" throws an Error.
Rory Archibald

I don't think there's an option (in later versions there is a TickLabelSpacingIsAuto property), but I'll do some testing.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
mss72

ASKER
I am still unclear why a new chart in Excel 2003 does have automatic TickLabelSpacing and yet once a value is supplied you cannot return to automatic
ASKER CERTIFIED SOLUTION
Rory Archibald

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mss72

ASKER
The problem remains because of the design of EXCEL. This is not the fault of the person answering the question