Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

axis range

Status
Not open for further replies.

barryodonnell

Mechanical
Jan 25, 2002
15
0
0
GB
Hi,

I have an odd request. I have developed a spreadsheet to plot the radial deformation of turbine casings in polar format (thanks for the help with this). The deformations can be magnified relative to the undeformed shape. However, the maxiumum axis scales can differ between the x and y axes spoiling the plot if the magnification is too large. I do not want to use the manual scale. Is it possible to reference a cell value or defined name as the maximum axis value? I tried inserting it in the gui to no avial.

Thansk in advance

Barry
 
Replies continue below

Recommended for you

yes it is possible.

while i have accomplished your request in the past, i cannot remember exactly how i did it, but i do remember writing vba code to accomplish it. i do not have the file with me - at home; however, i will retrieve it and provide you the necessary code and other techniques used to accomplish it.

i created a workbook that had about 100 different pump curves for a particular facility. naturally, there were different x & y scales that needed to be changed, depending upon selected pump. so, i wrote the code to update the axes, which by the way, is the only way to change the x & y axes scales. links to cell values is not possible.

in the meantime, someone else may furnish the code.
be patient!
-pmover
 
Thanks Pmover,

I would greatly appreciate this code. It would be useful at some future stage, if Excel could accept cell linked values however.

Barry
 
barryodonnell,

you will need to define cells within workbook to establish the minimum axes scale. for the code below, the cells are named Psmin and Pdmin.

Sub AxisScale()
Dim Pdmin As Single, Psmin As Single
Application.ScreenUpdating = False
Sheets("Pump Curves").Select
Psmin = Application.Sheets("Data & Calcs").Range("Psmin") ' define the minimum axis value
Application.Sheets("Data & Calcs").Range("Ps") = Psmin + 25' for charting purposes
Pdmin = Int(Application.Sheets("Data & Calcs").Range("Pdmin") / 100) * 100' define minimum axis value
Application.Sheets("Data & Calcs").Range("Pd") = Pdmin + 150' for charting purposes
' set minimum y-scale to Pdmin
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = Pdmin
End With
' set minimum x-scale to Psmin
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
.MinimumScale = Psmin
End With
ActiveChart.Deselect
Application.ScreenUpdating = True
End Sub

good luck!
-pmover
 
Excel allows you to plot a left and bottom axes and a right and bottmo axes. When you do a format data series, one of the tabs allows you to select the alternate axis

TTFN
 
pmover,
What did you plot for those 100 pumps?
Just head and flow, or did you have other curves on the same graph for 1 or more of NPSHr, Power, Efficiency, etc.?


PUMPDESIGNER
 
barry, you are welcome!

pumpdesigner, two charts on one chart sheet. 1 chart for head and efficiency vs flow and 1 for power (a bar chart, comparing driver power to actual power).
i did this just in case i had to do some diagnostic work at this particulat facility - never did though. btw, more like 40 pumps...
another location, the operators wanted to know what the discharge pressure would be based on inlet pressure (during plant commissioning activities). so i took the mfg charts and generated a pd vs ps chart (yes, i know ?), with ps, sg, and motor current as variables. during start-up at this facility, a pump (or two) would shutdown on motor current overload (sg a little high until lighter fluids were obtained). so the pumps had to be operated near min flow until the lighter fluids were obtained. slight adjustment, but not too difficult to accomplish.
for both cases, npsha/r was not an issue.
more than u asked for, but...
-pmover
 
Status
Not open for further replies.
Back
Top