#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default Graphing

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Graphing

What units do you want displayed on each axis? Inches/Feet/Miles cm/m/km???

That would help.
--
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Graphing

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default Graphing

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphing n^1.85 BillB Charts and Charting in Excel 1 February 25th 09 10:59 AM
HELP WITH GRAPHING PLEASE!!! Masterpasqua Excel Discussion (Misc queries) 0 March 4th 08 07:58 PM
Graphing R=1+E Mas Excel Discussion (Misc queries) 1 May 28th 07 02:33 PM
Graphing ace Charts and Charting in Excel 1 June 23rd 06 12:32 PM
Graphing Metalteck Excel Discussion (Misc queries) 1 July 21st 05 08:39 PM


All times are GMT +1. The time now is 05:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"