Thread: Graphing
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default Graphing

Barb,
I have figured out the problem that I was having but of coarse there is a
new issue now. when I run the macro for the chart it doesn't graph anything
out. The x and y axises are there but nothing for a series. When I go to
the series to check there is no x axis pick but the y axis is. When I pick
the x axis location it then graphs for me and all is well. Any help would be
appreciated. Thank you

"Eric" wrote:

Barb,
I have tried the code below and still am getting an error here is what I
have for the code. By the way I am going from pounds per cubic foot to
kilograms per meter cubed. Thank you for your help

ActiveSheet.DrawingObjects("chart 7").Select
ActiveSheet.ChartObjects("chart 7").Activate
With ActiveChart.Axes(xlValue)
.MinimumScale = 1
.MaximumScale = 1
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = False
End With
ActiveWindow.Visible = False
Range("b41").Select

ActiveSheet.DrawingObjects("chart 7").Select
ActiveSheet.ChartObjects("chart 7").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MaximumScale = ActiveSheet.Range("t12")
.MinimumScale = ActiveSheet.Range("s12")
.MinorUnit = 20
.MajorUnit = 1
.Crosses = xlAutomatic
.ReversePlotOrder = False
ScaleType = False
.TickLabels.NumberFormat = "0.0"

End With

'secondary axis
ActiveSheet.DrawingObjects("chart 7").Select
ActiveSheet.ChartObjects("chart 7").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue, xlSecondary)
.MaximumScale = ActiveSheet.Range("t12") * 16.01846
.MinimumScale = ActiveSheet.Range("s12") * 16.01846
End With

"Barb Reinhardt" wrote:

You're going to have to add a second series to the chart and have it use the
secondary axis. To "match" the scales, use something like this for code.
I converted from Feet to Meters here. Change the points for the second
series so they aren't displayed.

With ActiveChart.Axes(xlValue)
myMax = .MaximumScale
myMin = .MinimumScale
End With

With ActiveChart.Axes(xlValue, xlSecondary)
.MaximumScale = myMax * 0.3062
.MinimumScale = myMin * 0.3062
End With

--
HTH,
Barb Reinhardt



"Eric" wrote:

Is there away to have two (2) y-axises? I want english measurements on the
left and metric on the right. I have both calculated out in cells but am
wondering how to make the right side of the graph have anything. Any help
would be appreciated. Thank you in advance.
Eric