#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 69
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 733
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting wrong value due to ref? jesmin Excel Discussion (Misc queries) 2 March 16th 06 02:12 AM
What am I doing wrong? PFB1033 Excel Discussion (Misc queries) 1 February 13th 06 02:13 AM
What am I doing wrong? jewels Excel Worksheet Functions 8 December 8th 05 02:04 PM
Where am I going wrong? Pank Excel Discussion (Misc queries) 2 July 13th 05 01:05 PM
What's wrong with this vb? DaveMoore Excel Worksheet Functions 2 February 24th 05 01:29 PM


All times are GMT +1. The time now is 11:10 AM.

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

About Us

"It's about Microsoft Excel"