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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|