How to set X and Y values in Word VBA chart?
How to set vertical and horizontal values for a Word chart using VBA?
Code below assumes that you already have the necessary code to generate the chart.
This code below will only show how to set the X and Y values for a chart using VBA in a Word document.
Here's the code:
'Set value for Y axis or Vertical value
With cht.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 35
.MajorUnit = 5
.MinorUnit = 0
End With
' Set value for X axis or Horizontal value
With cht.Axes(xlCategory)
.MinimumScale = 0
.MaximumScale = 25
.MajorUnit = 5
.MinorUnit = 0
End With
How to set vertical and horizontal values for a Word chart using VBA?
Code below assumes that you already have the necessary code to generate the chart.
This code below will only show how to set the X and Y values for a chart using VBA in a Word document.
Here's the code:
'Set value for Y axis or Vertical value
With cht.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 35
.MajorUnit = 5
.MinorUnit = 0
End With
' Set value for X axis or Horizontal value
With cht.Axes(xlCategory)
.MinimumScale = 0
.MaximumScale = 25
.MajorUnit = 5
.MinorUnit = 0
End With
Cheers! Till next time.
================================
Free Android Apps:
Click on links below to find out more:
Excel Keyboard shortcuts guide
Linux Android App cheat sheet:
Multiplication Table for early learners
https://play.google.com/store/apps/details?id=com.TableMultiplication
Catholic Rosary Guide for Android:
Divine Mercy Chaplet Guide (A Powerful prayer):
Comments
Post a Comment