Chart on powerpoint slide - formatting changes after data is filled in.

On the attached image one sees that the top left chart has a 'standard' number format for the axis wheras the bottom right has a 'scientific' format.
Initially both charts had the 'standard' number format for the labels.  After filling the dataset for the chart with VBA code running in Microsoft Access (no changes to formatting, only the numbers to be displayed) the one chart is OK but the other has been changed to 'scientific' format which is unwanted.

Why is this happening?
More important - how can I set the axis tick lables formatting back to 'standard' via VBA code?
LVL 45
AndyAinscowFreelance programmer / ConsultantAsked:
Who is Participating?
 
Rgonzo1971Commented:
then try

ActiveChart.Axes(xlCategory).TickLabels.NumberFormat = "General"
 ActiveChart.Axes(xlValue).TickLabels.NumberFormat = "General"
0
 
Rgonzo1971Commented:
No File
0
 
Rgonzo1971Commented:
HI,

Maybe

    ActiveChart.Axes(xlCategory).TickLabels.NumberFormat = "0"
    ActiveChart.Axes(xlValue).TickLabels.NumberFormat = "0"

Regards
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
AndyAinscowFreelance programmer / ConsultantAuthor Commented:
Aaagh, here is the image.

SNAG-0000.bmp
Thanks.  That just displays without any decimal point.
0
 
Rgonzo1971Commented:
ActiveChart.Axes(xlCategory).TickLabels.NumberFormat = "0.0"
ActiveChart.Axes(xlValue).TickLabels.NumberFormat = "0.0"
0
 
AndyAinscowFreelance programmer / ConsultantAuthor Commented:
Getting closer.
The 0.0 isn't suitable as some axes then just show each tick label as zero however .NumberFormat = "0.####" is rather closer.
SNAG-0001.bmpHowever that now leaves an ugly '.' when the labels are all integer - see the 'BUT' graphs
0
 
Rgonzo1971Commented:
then try this format

"[>=1]0;[=0]0;0.######"

Regards
0
 
AndyAinscowFreelance programmer / ConsultantAuthor Commented:
That cures that but then promptly brings another:
SNAG-0002.bmpWhere the axis now has two lables both of 2 with the custom format
SNAG-0003.bmp

What I want (which is how the empty chart is formatted) results in
SNAG-0004.bmpusing the 'standard' setting for the label format
SNAG-0005.bmp

For some reason this setting is being replaced on some, but not all, charts after I fill the values into the dataset.
0
 
AndyAinscowFreelance programmer / ConsultantAuthor Commented:
I'd tried 'Standard' before asking the question - it barfed.  Now with 'General' it works perfectly.
Thanks.
0
 
Rgonzo1971Commented:
General in English

ActiveChart.Axes(xlCategory).TickLabels.NumberFormatLocal = "Standard"
0
 
AndyAinscowFreelance programmer / ConsultantAuthor Commented:
Unfortunately Standard is also an English word with an similar meaning in this context.  Anyway it works now.  :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.