Update "Display Units" property for Graph using VBA

  • Thread starter Thread starter jwilliam
  • Start date Start date
J

jwilliam

Hello,

I would like to dynamically change the "Display Units" property under
the "Format Axis" menu item for the graphs within my powerpoint
presentations using VBA. Does anyone have any code for that? I'm
having difficulties finding it.

thank You!

Jenise
 
Hi,

Assuming MSGraph, change slide and object indexes to suit.

Sub SetChartDisplayUnits()
'
' Display Hundreds on the Y axis of a column chart
'
With ActivePresentation.Slides(1)
With .Shapes(3).OLEFormat.Object
With .Application.chart
With .axes(2) ' xlValue
.HasDisplayUnitLabel = True
.DisplayUnit = -2 'xlHundreds
End With
End With
End With
End With

End Sub

Cheers
Andy
 
Hi Andy,

Thank You, that worked! Sorry for the two posts, but I was having
trouble with the site for a couple of days.

Also, where would I find property information like the code below? Are
there are sites that have a listing of all the properties for Excel and
powerpoint? That would be great because I couldn't find it in the
office VBA help....or perhaps i just looked under the wrong subject.

thanks!

Jenise
 
Back
Top