#1   Report Post  
Posted to microsoft.public.excel.misc
Ant Ant is offline
external usenet poster
 
Posts: 53
Default Help with graphs

Hi. In a worksheet I have some code which automatically updates the Gridlines
each time new source data is updated. It has been working fine however for
some reason now, it updates whilst going through the code, but when a cell is
chosen outside the graph eg cell A8, it resorts back to the original scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't stay on
the scale above?

Cheers.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Help with graphs

Where is the code? In the worksheet module? This piece of code doesn't
respond to any changing values, it sets the major and minor unit (which set
the gridline spacing) to constant values.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Hi. In a worksheet I have some code which automatically updates the
Gridlines
each time new source data is updated. It has been working fine however for
some reason now, it updates whilst going through the code, but when a cell
is
chosen outside the graph eg cell A8, it resorts back to the original
scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't stay
on
the scale above?

Cheers.



  #3   Report Post  
Posted to microsoft.public.excel.misc
Ant Ant is offline
external usenet poster
 
Posts: 53
Default Help with graphs

Yes, this is just an excerpt from the full code within the worksheet module.
It does set the major and minor unit, however when the macro has finished the
gridlines revert back to the previous scale. When I step through the code
line by line, I can actually see the gridlines changing to what the code
specifies, however once it steps out of the graph (ie to cell A8) the scale
changes back to the old scale....which I cannot explain.

"Jon Peltier" wrote:

Where is the code? In the worksheet module? This piece of code doesn't
respond to any changing values, it sets the major and minor unit (which set
the gridline spacing) to constant values.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Hi. In a worksheet I have some code which automatically updates the
Gridlines
each time new source data is updated. It has been working fine however for
some reason now, it updates whilst going through the code, but when a cell
is
chosen outside the graph eg cell A8, it resorts back to the original
scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't stay
on
the scale above?

Cheers.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Help with graphs

I cannot explain it either. Is there more code in a SelectionChange event
procedure which may affect the chart?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Yes, this is just an excerpt from the full code within the worksheet
module.
It does set the major and minor unit, however when the macro has finished
the
gridlines revert back to the previous scale. When I step through the code
line by line, I can actually see the gridlines changing to what the code
specifies, however once it steps out of the graph (ie to cell A8) the
scale
changes back to the old scale....which I cannot explain.

"Jon Peltier" wrote:

Where is the code? In the worksheet module? This piece of code doesn't
respond to any changing values, it sets the major and minor unit (which
set
the gridline spacing) to constant values.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Hi. In a worksheet I have some code which automatically updates the
Gridlines
each time new source data is updated. It has been working fine however
for
some reason now, it updates whilst going through the code, but when a
cell
is
chosen outside the graph eg cell A8, it resorts back to the original
scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't
stay
on
the scale above?

Cheers.






  #5   Report Post  
Posted to microsoft.public.excel.misc
Ant Ant is offline
external usenet poster
 
Posts: 53
Default Help with graphs

Perhaps it is just "one of those things". I actually have 2 graphs which
update at the same time (well, one after eachother that is). One works fine
but the other reverts to the original data each time once the code comes out
of the graph. The only way to change the scale is to manually click in and do
it. Those changes then become the scale it keeps reverting back to. So,
strangely enough graph 1 is dynamic but graph 2 is not. Funny thing is it was
working fine one day and then not the next. It's quite simple code and I do
not have a SelectionChange event. It may be a case of re-writing the code
from scratch.

"Jon Peltier" wrote:

I cannot explain it either. Is there more code in a SelectionChange event
procedure which may affect the chart?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Yes, this is just an excerpt from the full code within the worksheet
module.
It does set the major and minor unit, however when the macro has finished
the
gridlines revert back to the previous scale. When I step through the code
line by line, I can actually see the gridlines changing to what the code
specifies, however once it steps out of the graph (ie to cell A8) the
scale
changes back to the old scale....which I cannot explain.

"Jon Peltier" wrote:

Where is the code? In the worksheet module? This piece of code doesn't
respond to any changing values, it sets the major and minor unit (which
set
the gridline spacing) to constant values.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Hi. In a worksheet I have some code which automatically updates the
Gridlines
each time new source data is updated. It has been working fine however
for
some reason now, it updates whilst going through the code, but when a
cell
is
chosen outside the graph eg cell A8, it resorts back to the original
scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't
stay
on
the scale above?

Cheers.








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Help with graphs

There must be more code that you didn't post. Maybe it would help to see it
all.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Perhaps it is just "one of those things". I actually have 2 graphs which
update at the same time (well, one after eachother that is). One works
fine
but the other reverts to the original data each time once the code comes
out
of the graph. The only way to change the scale is to manually click in and
do
it. Those changes then become the scale it keeps reverting back to. So,
strangely enough graph 1 is dynamic but graph 2 is not. Funny thing is it
was
working fine one day and then not the next. It's quite simple code and I
do
not have a SelectionChange event. It may be a case of re-writing the code
from scratch.

"Jon Peltier" wrote:

I cannot explain it either. Is there more code in a SelectionChange event
procedure which may affect the chart?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Yes, this is just an excerpt from the full code within the worksheet
module.
It does set the major and minor unit, however when the macro has
finished
the
gridlines revert back to the previous scale. When I step through the
code
line by line, I can actually see the gridlines changing to what the
code
specifies, however once it steps out of the graph (ie to cell A8) the
scale
changes back to the old scale....which I cannot explain.

"Jon Peltier" wrote:

Where is the code? In the worksheet module? This piece of code doesn't
respond to any changing values, it sets the major and minor unit
(which
set
the gridline spacing) to constant values.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Hi. In a worksheet I have some code which automatically updates the
Gridlines
each time new source data is updated. It has been working fine
however
for
some reason now, it updates whilst going through the code, but when
a
cell
is
chosen outside the graph eg cell A8, it resorts back to the original
scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't
stay
on
the scale above?

Cheers.








  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Help with graphs

Jon hope you can help. I have data which feeds in to a simple chart. data is
added each day and i want the chart to update with the new data. The problem
i have is if i extend the date range to include future values i add the graph
looks messy. This is because the graph plots cumm totals so for eg the
current cumm value up to 16th Mar is 2544 if i extend the range up to say 31
dec then i have 2544 values upto dec 31st waiting for new values to be added.
So currently i have to manually change the date range to include the current
last row which is a bit clumsy. Do you have a simple solution to this
thank you
--
thank you
censura


"Jon Peltier" wrote:

Where is the code? In the worksheet module? This piece of code doesn't
respond to any changing values, it sets the major and minor unit (which set
the gridline spacing) to constant values.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Hi. In a worksheet I have some code which automatically updates the
Gridlines
each time new source data is updated. It has been working fine however for
some reason now, it updates whilst going through the code, but when a cell
is
chosen outside the graph eg cell A8, it resorts back to the original
scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't stay
on
the scale above?

Cheers.




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Help with graphs

Dynamic Charts:

http://peltiertech.com/Excel/Charts/...umnChart1.html
http://peltiertech.com/Excel/Charts/Dynamics.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"censura" wrote in message
...
Jon hope you can help. I have data which feeds in to a simple chart. data
is
added each day and i want the chart to update with the new data. The
problem
i have is if i extend the date range to include future values i add the
graph
looks messy. This is because the graph plots cumm totals so for eg the
current cumm value up to 16th Mar is 2544 if i extend the range up to say
31
dec then i have 2544 values upto dec 31st waiting for new values to be
added.
So currently i have to manually change the date range to include the
current
last row which is a bit clumsy. Do you have a simple solution to this
thank you
--
thank you
censura


"Jon Peltier" wrote:

Where is the code? In the worksheet module? This piece of code doesn't
respond to any changing values, it sets the major and minor unit (which
set
the gridline spacing) to constant values.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ant" wrote in message
...
Hi. In a worksheet I have some code which automatically updates the
Gridlines
each time new source data is updated. It has been working fine however
for
some reason now, it updates whilst going through the code, but when a
cell
is
chosen outside the graph eg cell A8, it resorts back to the original
scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't
stay
on
the scale above?

Cheers.






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
excel graphs won't update ejfu Charts and Charting in Excel 0 July 6th 06 11:18 PM
Pasting Graphs - making me crazy! BankC Excel Discussion (Misc queries) 1 April 25th 06 06:12 PM
HYPERLINK GRAPHS Aurora Charts and Charting in Excel 0 April 10th 06 04:46 PM
Are there better GRAPHS within EXCEL or Add-on graphs? Deb Charts and Charting in Excel 1 February 1st 06 01:19 PM
Copying Charts and graphs to another worksheet with formulas bebz Excel Worksheet Functions 1 December 31st 05 11:45 AM


All times are GMT +1. The time now is 10:03 PM.

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

About Us

"It's about Microsoft Excel"