Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Any wrong with this?
I have this piece of code:
With ActiveChart.Axes(xlValue) .MinimumScale = BaseCPM .MaximumScaleIsAuto = True .MinorUnitIsAuto = True .MajorUnitIsAuto = True .Crosses = xlAutomatic .ReversePlotOrder = False .ScaleType = xlLinear .DisplayUnit = xlNone End With In the 2nd row of the code, BaseCPM is a cell name where I want the macro to update that value. It is not working right? Jo |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Any wrong with this?
Jo wrote...
I have this piece of code: With ActiveChart.Axes(xlValue) .MinimumScale = BaseCPM .MaximumScaleIsAuto = True .MinorUnitIsAuto = True .MajorUnitIsAuto = True .Crosses = xlAutomatic .ReversePlotOrder = False .ScaleType = xlLinear .DisplayUnit = xlNone End With In the 2nd row of the code, BaseCPM is a cell name where I want the macro to update that value. .... VBA will treat BaseCPM as a VBA variable rather than as a name. Also, the code above sets ActiveChart.Axes(xlValue).MinimumScale to BaseCPM rather than updating BaseCPM with anything. If this is a defined name in the workbook, you need to use .MinimumScale = Names("BaseCPM").RefersToRange.Value or .MinimumScale = Evaluate("BaseCPM") To change the value of the cell to which BaseCPM refers, use Names("BaseCPM").RefersToRange.Value = ..whatever.. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Getting wrong value due to ref? | Excel Discussion (Misc queries) | |||
What am I doing wrong? | Excel Discussion (Misc queries) | |||
What am I doing wrong? | Excel Worksheet Functions | |||
Where am I going wrong? | Excel Discussion (Misc queries) | |||
What's wrong with this vb? | Excel Worksheet Functions |