#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
Ant Ant is offline
external usenet poster
 
Posts: 53
Default Help with graphs

ok - here is the code. You will see 2 products with different data. SUMIF's
are used to populate data range for graphs which are working fine. You will
notice two charts with numbers to change the scale. Chart 32 works fine and
changes depending on which product is selected. Chart 60, however is the one
which changes during the macro to the correct scale, but once it steps to
Range("A8").Select, the scale reverts back to the original scale. This is the
part I don't understand...

Sub Group_Selector_and_Line_Graph_Update()

If Range("B6").Value = "Product 1" Then

Range("A8").Select
ActiveSheet.Outline.ShowLevels RowLevels:=2
Rows("47:58").Select
On Error Resume Next
Selection.Rows.Ungroup
Rows("64:75").Select
On Error Resume Next
Selection.Rows.Ungroup
Rows("81:92").Select
On Error Resume Next
Selection.Rows.Ungroup

Application.Goto Reference:="P1"
Selection.Copy
Sheets("Portfolio Graph").Select
Range("B47").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Rows("52:58").Select
On Error Resume Next
Selection.Rows.Group
Rows("69:75").Select
On Error Resume Next
Selection.Rows.Group
Rows("86:92").Select
On Error Resume Next
Selection.Rows.Group
Range("A8").Select
ActiveSheet.Outline.ShowLevels RowLevels:=1

ActiveSheet.ChartObjects("Chart 32").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 2000000
.MaximumScale = 3000000
.MinorUnit = 40000
.MajorUnit = 200000
.Crosses = xlCustom
.CrossesAt = 2000000
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

ActiveSheet.ChartObjects("Chart 60").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 10000000
.MinorUnit = 200000
.MajorUnit = 2000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

ElseIf Range("B6").Value = "Product 2" Then

ActiveSheet.Outline.ShowLevels RowLevels:=2
Rows("47:58").Select
On Error Resume Next
Selection.Rows.Ungroup
Rows("64:75").Select
On Error Resume Next
Selection.Rows.Ungroup
Rows("81:92").Select
On Error Resume Next
Selection.Rows.Ungroup

Application.Goto Reference:="P2"
Selection.Copy
Sheets("Portfolio Graph").Select
Range("B47").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Rows("52:58").Select
On Error Resume Next
Selection.Rows.Group
Rows("69:75").Select
On Error Resume Next
Selection.Rows.Group
Rows("86:92").Select
On Error Resume Next
Selection.Rows.Group
Range("A9").Select
ActiveSheet.Outline.ShowLevels RowLevels:=1

ActiveSheet.ChartObjects("Chart 32").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select

With ActiveChart.Axes(xlValue)
.MinimumScale = 9000000
.MaximumScale = 13500000
.MinorUnitIsAuto = True
.MajorUnit = 1000000
.Crosses = xlCustom
.CrossesAt = 9000000
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

ActiveSheet.ChartObjects("Chart 60").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select

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
nd If

End Sub

"Jon Peltier" wrote:

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.









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

Sorry, the additional code hasn't shed any additional light on the issue.

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


"Ant" wrote in message
...
ok - here is the code. You will see 2 products with different data.
SUMIF's
are used to populate data range for graphs which are working fine. You
will
notice two charts with numbers to change the scale. Chart 32 works fine
and
changes depending on which product is selected. Chart 60, however is the
one
which changes during the macro to the correct scale, but once it steps to
Range("A8").Select, the scale reverts back to the original scale. This is
the
part I don't understand...

Sub Group_Selector_and_Line_Graph_Update()

If Range("B6").Value = "Product 1" Then

Range("A8").Select
ActiveSheet.Outline.ShowLevels RowLevels:=2
Rows("47:58").Select
On Error Resume Next
Selection.Rows.Ungroup
Rows("64:75").Select
On Error Resume Next
Selection.Rows.Ungroup
Rows("81:92").Select
On Error Resume Next
Selection.Rows.Ungroup

Application.Goto Reference:="P1"
Selection.Copy
Sheets("Portfolio Graph").Select
Range("B47").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Rows("52:58").Select
On Error Resume Next
Selection.Rows.Group
Rows("69:75").Select
On Error Resume Next
Selection.Rows.Group
Rows("86:92").Select
On Error Resume Next
Selection.Rows.Group
Range("A8").Select
ActiveSheet.Outline.ShowLevels RowLevels:=1

ActiveSheet.ChartObjects("Chart 32").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 2000000
.MaximumScale = 3000000
.MinorUnit = 40000
.MajorUnit = 200000
.Crosses = xlCustom
.CrossesAt = 2000000
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

ActiveSheet.ChartObjects("Chart 60").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 10000000
.MinorUnit = 200000
.MajorUnit = 2000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

ElseIf Range("B6").Value = "Product 2" Then

ActiveSheet.Outline.ShowLevels RowLevels:=2
Rows("47:58").Select
On Error Resume Next
Selection.Rows.Ungroup
Rows("64:75").Select
On Error Resume Next
Selection.Rows.Ungroup
Rows("81:92").Select
On Error Resume Next
Selection.Rows.Ungroup

Application.Goto Reference:="P2"
Selection.Copy
Sheets("Portfolio Graph").Select
Range("B47").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Rows("52:58").Select
On Error Resume Next
Selection.Rows.Group
Rows("69:75").Select
On Error Resume Next
Selection.Rows.Group
Rows("86:92").Select
On Error Resume Next
Selection.Rows.Group
Range("A9").Select
ActiveSheet.Outline.ShowLevels RowLevels:=1

ActiveSheet.ChartObjects("Chart 32").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select

With ActiveChart.Axes(xlValue)
.MinimumScale = 9000000
.MaximumScale = 13500000
.MinorUnitIsAuto = True
.MajorUnit = 1000000
.Crosses = xlCustom
.CrossesAt = 9000000
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

ActiveSheet.ChartObjects("Chart 60").Activate
ActiveChart.Axes(xlValue).MajorGridlines.Select

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
nd If

End Sub

"Jon Peltier" wrote:

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.











  #9   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.




  #10   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 04:57 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"