E
Eric
I am trying to write a macro for two y axises. Left side is english (pounds
per cubic foot) and the right is metric. What I have now will allow me to
graph the english with no problem but when I try to add a second y axis I
then don't get any points on the graph. Can anyone help.....Here is the
macro I am using.
column S is moisture content
Column T is english version
Column U is meteric version
Range("AD7").Select
Application.CutCopyMode = False
ActiveSheet.ChartObjects("chart 7").Activate
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData Source:=Range("S19:U22"), _
PlotBy:=xlColumns
ActiveWindow.Visible = False
Range("k4").Select
'english units
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
'secondary axis
'With ActiveChart.Axes(xlValue, xlSecondary)
'.MaximumScale = ActiveSheet.Range("t12") * 16.01846
'.MinimumScale = ActiveSheet.Range("s12") * 16.01846
'End With
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
'Case Else
'End Select
'x scale
Application.ScreenUpdating = False
ActiveSheet.DrawingObjects("chart 7").Select
ActiveSheet.ChartObjects("chart 7").Activate
With ActiveChart.Axes(xlCategory)
.MaximumScale = ActiveSheet.Range("s22")
.MinimumScale = ActiveSheet.Range("s19")
.Crosses = xlAutomatic
.ReversePlotOrder = False
' .ScaleType = False
End With
End Sub
per cubic foot) and the right is metric. What I have now will allow me to
graph the english with no problem but when I try to add a second y axis I
then don't get any points on the graph. Can anyone help.....Here is the
macro I am using.
column S is moisture content
Column T is english version
Column U is meteric version
Range("AD7").Select
Application.CutCopyMode = False
ActiveSheet.ChartObjects("chart 7").Activate
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData Source:=Range("S19:U22"), _
PlotBy:=xlColumns
ActiveWindow.Visible = False
Range("k4").Select
'english units
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
'secondary axis
'With ActiveChart.Axes(xlValue, xlSecondary)
'.MaximumScale = ActiveSheet.Range("t12") * 16.01846
'.MinimumScale = ActiveSheet.Range("s12") * 16.01846
'End With
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
'Case Else
'End Select
'x scale
Application.ScreenUpdating = False
ActiveSheet.DrawingObjects("chart 7").Select
ActiveSheet.ChartObjects("chart 7").Activate
With ActiveChart.Axes(xlCategory)
.MaximumScale = ActiveSheet.Range("s22")
.MinimumScale = ActiveSheet.Range("s19")
.Crosses = xlAutomatic
.ReversePlotOrder = False
' .ScaleType = False
End With
End Sub