A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro Chart Ranges



 
 
Thread Tools Display Modes
  #1  
Old March 15th, 2004, 11:07 AM
Reto Walker
external usenet poster
 
Posts: n/a
Default Macro Chart Ranges

Hi everyone

How can I adjust the following macro to make the MinimumScale value and
MaximumScale value dynamic (by referencing a cell in one of my spreadsheets)
instead of fixed (currently 5400 and 7000)

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 3/15/04 by Reto Walker
'

'
ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 5400
.MaximumScale = 7000
.MinorUnit = 100
.MajorUnit = 500
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
End Sub

Thanks in advance

Regards,

Reto


  #2  
Old March 15th, 2004, 11:16 AM
Andy Pope
external usenet poster
 
Posts: n/a
Default Macro Chart Ranges

Hi Reto,

The following will use the values in A1 and A2 on Sheet1.

..MinimumScale = Worksheets("Sheet1").Range("A1").value
..MaximumScale = Worksheets("Sheet1").Range("A2").value

Cheers
Andy

Reto Walker wrote:

Hi everyone

How can I adjust the following macro to make the MinimumScale value and
MaximumScale value dynamic (by referencing a cell in one of my spreadsheets)
instead of fixed (currently 5400 and 7000)

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 3/15/04 by Reto Walker
'

'
ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 5400
.MaximumScale = 7000
.MinorUnit = 100
.MajorUnit = 500
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
End Sub

Thanks in advance

Regards,

Reto



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:29 PM.


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