Code to Set Y Axis Values in Graph

snowsride

Registered User.
Local time
Today, 12:51
Joined
Nov 29, 2001
Messages
33
I need some code to set the Y values in Graph. I have already had some advice but the code doen't work for me. I am a novice at VBA and my attempts to modify the code have been unsuccessful. My latest attempt is:

Dim myGraph As Object, myChart As Chart

Set myGraph = CreateObject("Graph.Application")
Set myChart = myGraph.Chart("Graph1")

With myChart

.Axes(xlValue).MinimumScale = CDbl(DMin("[ProductSales]", "Sales by
Category"))
.Axes(xlValue).MaximumScale = CDbl(DMax("[ProductSales]", "Sales by
Category"))

End With

Any help appreciated.
 

Users who are viewing this thread

Back
Top Bottom