Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Automate graphics range on the y axis

1 view
Skip to first unread message

Steve Carpentier

unread,
Feb 15, 2001, 12:50:58 AM2/15/01
to
Help from people who are familar with Excel Graphics !!

My problem is that I'm building a report in Excel for a batch
of product that I have produced that contained many graphics,
depending on product made, the range of the y axis changed,
so to solved my problem I want to know how to put variables
instead of fix numbers for the rande of the y axis.


--
Salutations / Bye / Thanks
Steve Carpentier
E-mail: steve.ca...@concepta.com
E-mail: scarp...@tr.kruger.com

Peltier

unread,
Feb 15, 2001, 9:23:17 PM2/15/01
to
Steve -

You could keep the "Auto" box checked for each parameter in the Axis
Scale dialog window, and let Excel scale the axes automatically. If you
want to put values into the worksheet that get used for the scaling
parameters, then you could write a macro to scale using these
parameters. The macro would look like this:

Sub ScaleYAxis()
' Select the chart, then run the macro

Dim mySheet As Worksheet
Dim myChart As Chart
Dim myRange As Range

Set mySheet = ActiveSheet
Set myChart = ActiveChart

Set myRange = Application.InputBox _
(prompt:="Please Select a Range" & vbCrLf & vbCrLf & _
"Top to Bottom: Ymin - Ymax - Major - Minor", _
Title:="Enter Range", Type:=8)

With myChart.Axes(xlValue)
.MinimumScale = myRange.Range("A1")
.MaximumScale = myRange.Range("A2")
.MajorUnit = myRange.Range("A3")
.MinorUnit = myRange.Range("A4")
End With

End Sub

Select the chart, then run the macro. You can make a command bar button
and assign it to this macro.

- Jon
_______

Steve Carpentier

unread,
Feb 15, 2001, 11:14:27 PM2/15/01
to
Thanks, I will try it and see

Bye Steve !!
Peltier <pel...@home.com> a écrit dans le message :
3A8C8FA6...@home.com...

0 new messages