Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Scaling Graphs

Hi

Can anyone help me gette the below code working - novice VB programmer :-)

I want the scale of Graph 1 and 2 to change each time the value in row 2 and
col 4 changes. Min and Max scacle Ã*s set in i2 and i4 when changing the above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Scaling Graphs

You didn't hint at where the code stops, or what error messages you saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB programmer :-)

I want the scale of Graph 1 and 2 to change each time the value in row 2
and
col 4 changes. Min and Max scacle ís set in i2 and i4 when changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Scaling Graphs

Hi Jon

That did the job - shame on me for not seeing this my self :-)

All how this just lead to the next problem - the change of scale didn't work
like I supposed. The timescale is changed allright, but some of the
information (vertical deadlines and budget lines) get messed up, when
changing view :-(

It's a bit difficult to explain but thanks for the help so far.

/steen

"Jon Peltier" wrote:

You didn't hint at where the code stops, or what error messages you saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB programmer :-)

I want the scale of Graph 1 and 2 to change each time the value in row 2
and
col 4 changes. Min and Max scacle Ã*s set in i2 and i4 when changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Scaling Graphs

How are these other features added to the chart?

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


"Steen" wrote in message
...
Hi Jon

That did the job - shame on me for not seeing this my self :-)

All how this just lead to the next problem - the change of scale didn't
work
like I supposed. The timescale is changed allright, but some of the
information (vertical deadlines and budget lines) get messed up, when
changing view :-(

It's a bit difficult to explain but thanks for the help so far.

/steen

"Jon Peltier" wrote:

You didn't hint at where the code stops, or what error messages you saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB programmer
:-)

I want the scale of Graph 1 and 2 to change each time the value in row
2
and
col 4 changes. Min and Max scacle ís set in i2 and i4 when changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Scaling Graphs

Hi Jon

Thanks for coming back on the issue - I'm quite busy at the moment but I
will try to make an explanation during the weekend.

/Steen

"Jon Peltier" wrote:

How are these other features added to the chart?

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


"Steen" wrote in message
...
Hi Jon

That did the job - shame on me for not seeing this my self :-)

All how this just lead to the next problem - the change of scale didn't
work
like I supposed. The timescale is changed allright, but some of the
information (vertical deadlines and budget lines) get messed up, when
changing view :-(

It's a bit difficult to explain but thanks for the help so far.

/steen

"Jon Peltier" wrote:

You didn't hint at where the code stops, or what error messages you saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB programmer
:-)

I want the scale of Graph 1 and 2 to change each time the value in row
2
and
col 4 changes. Min and Max scacle Ã*s set in i2 and i4 when changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Scaling Graphs

Hi again

I've been looking a little further on the problem. It seem as the changing
of scale on x-axs i ok, but my budget lines and deadlines don't follow this
change. These lines has been added using the following link:
http://peltiertech.com/Excel/Charts/...ertSeries.html

The problem might have somthing to do with the use of a secondary axis...

Can anyone help me out hire?

/Steen

"Steen" wrote:

Hi Jon

Thanks for coming back on the issue - I'm quite busy at the moment but I
will try to make an explanation during the weekend.

/Steen

"Jon Peltier" wrote:

How are these other features added to the chart?

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


"Steen" wrote in message
...
Hi Jon

That did the job - shame on me for not seeing this my self :-)

All how this just lead to the next problem - the change of scale didn't
work
like I supposed. The timescale is changed allright, but some of the
information (vertical deadlines and budget lines) get messed up, when
changing view :-(

It's a bit difficult to explain but thanks for the help so far.

/steen

"Jon Peltier" wrote:

You didn't hint at where the code stops, or what error messages you saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB programmer
:-)

I want the scale of Graph 1 and 2 to change each time the value in row
2
and
col 4 changes. Min and Max scacle Ã*s set in i2 and i4 when changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Scaling Graphs

You have to alter the X values of the added series to make their scale
compatible with the existing category or time scale axis, or coordinate a
secondary X axis if that's what you're using.

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


"Steen" wrote in message
...
Hi again

I've been looking a little further on the problem. It seem as the changing
of scale on x-axs i ok, but my budget lines and deadlines don't follow
this
change. These lines has been added using the following link:
http://peltiertech.com/Excel/Charts/...ertSeries.html

The problem might have somthing to do with the use of a secondary axis...

Can anyone help me out hire?

/Steen

"Steen" wrote:

Hi Jon

Thanks for coming back on the issue - I'm quite busy at the moment but I
will try to make an explanation during the weekend.

/Steen

"Jon Peltier" wrote:

How are these other features added to the chart?

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


"Steen" wrote in message
...
Hi Jon

That did the job - shame on me for not seeing this my self :-)

All how this just lead to the next problem - the change of scale
didn't
work
like I supposed. The timescale is changed allright, but some of the
information (vertical deadlines and budget lines) get messed up, when
changing view :-(

It's a bit difficult to explain but thanks for the help so far.

/steen

"Jon Peltier" wrote:

You didn't hint at where the code stops, or what error messages you
saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB
programmer
:-)

I want the scale of Graph 1 and 2 to change each time the value in
row
2
and
col 4 changes. Min and Max scacle ís set in i2 and i4 when
changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart
1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart
2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Scaling Graphs

Hi Jon

Thanks for the quick reply, any help on how to do this - I'm no superman in
making VB scripts? :-)

/Steen

"Jon Peltier" wrote:

You have to alter the X values of the added series to make their scale
compatible with the existing category or time scale axis, or coordinate a
secondary X axis if that's what you're using.

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


"Steen" wrote in message
...
Hi again

I've been looking a little further on the problem. It seem as the changing
of scale on x-axs i ok, but my budget lines and deadlines don't follow
this
change. These lines has been added using the following link:
http://peltiertech.com/Excel/Charts/...ertSeries.html

The problem might have somthing to do with the use of a secondary axis...

Can anyone help me out hire?

/Steen

"Steen" wrote:

Hi Jon

Thanks for coming back on the issue - I'm quite busy at the moment but I
will try to make an explanation during the weekend.

/Steen

"Jon Peltier" wrote:

How are these other features added to the chart?

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


"Steen" wrote in message
...
Hi Jon

That did the job - shame on me for not seeing this my self :-)

All how this just lead to the next problem - the change of scale
didn't
work
like I supposed. The timescale is changed allright, but some of the
information (vertical deadlines and budget lines) get messed up, when
changing view :-(

It's a bit difficult to explain but thanks for the help so far.

/steen

"Jon Peltier" wrote:

You didn't hint at where the code stops, or what error messages you
saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB
programmer
:-)

I want the scale of Graph 1 and 2 to change each time the value in
row
2
and
col 4 changes. Min and Max scacle Ã*s set in i2 and i4 when
changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart
1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart
2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub









  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Scaling Graphs

Who mentioned anything about VBA? It's a matter of lining up the data.

What does the data for the time series look like, and the data for the added
series?

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


"Steen" wrote in message
...
Hi Jon

Thanks for the quick reply, any help on how to do this - I'm no superman
in
making VB scripts? :-)

/Steen

"Jon Peltier" wrote:

You have to alter the X values of the added series to make their scale
compatible with the existing category or time scale axis, or coordinate a
secondary X axis if that's what you're using.

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


"Steen" wrote in message
...
Hi again

I've been looking a little further on the problem. It seem as the
changing
of scale on x-axs i ok, but my budget lines and deadlines don't follow
this
change. These lines has been added using the following link:
http://peltiertech.com/Excel/Charts/...ertSeries.html

The problem might have somthing to do with the use of a secondary
axis...

Can anyone help me out hire?

/Steen

"Steen" wrote:

Hi Jon

Thanks for coming back on the issue - I'm quite busy at the moment but
I
will try to make an explanation during the weekend.

/Steen

"Jon Peltier" wrote:

How are these other features added to the chart?

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


"Steen" wrote in message
...
Hi Jon

That did the job - shame on me for not seeing this my self :-)

All how this just lead to the next problem - the change of scale
didn't
work
like I supposed. The timescale is changed allright, but some of
the
information (vertical deadlines and budget lines) get messed up,
when
changing view :-(

It's a bit difficult to explain but thanks for the help so far.

/steen

"Jon Peltier" wrote:

You didn't hint at where the code stops, or what error messages
you
saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB
programmer
:-)

I want the scale of Graph 1 and 2 to change each time the value
in
row
2
and
col 4 changes. Min and Max scacle ís set in i2 and i4 when
changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart
1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart
2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub











  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Scaling Graphs

Hi again Jon

Sorry for been "out" for a long time - I have been very busy and are looking
forwart to a waction in week 11.

The reason for the VB scripting issue is that I want to be able to "zoom"
the graph(s) at specific date intervals and back again. I have tried to do
this with the script below and i almost work, besides the delines and budget
lines I have inserted.

Data used in the graps are quite simple:

Date - X: %Finished - Y:
2007-01-01 0
2007-01-02 2
...... ....
2007-01-28 100

Deadline - X: Value - Sec. Y
2007-01-26 0
2007-01-26 100

I also have some budget lines and they are basical done the same way as the
deadlines.

/Steen


"Jon Peltier" wrote:

Who mentioned anything about VBA? It's a matter of lining up the data.

What does the data for the time series look like, and the data for the added
series?

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


"Steen" wrote in message
...
Hi Jon

Thanks for the quick reply, any help on how to do this - I'm no superman
in
making VB scripts? :-)

/Steen

"Jon Peltier" wrote:

You have to alter the X values of the added series to make their scale
compatible with the existing category or time scale axis, or coordinate a
secondary X axis if that's what you're using.

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


"Steen" wrote in message
...
Hi again

I've been looking a little further on the problem. It seem as the
changing
of scale on x-axs i ok, but my budget lines and deadlines don't follow
this
change. These lines has been added using the following link:
http://peltiertech.com/Excel/Charts/...ertSeries.html

The problem might have somthing to do with the use of a secondary
axis...

Can anyone help me out hire?

/Steen

"Steen" wrote:

Hi Jon

Thanks for coming back on the issue - I'm quite busy at the moment but
I
will try to make an explanation during the weekend.

/Steen

"Jon Peltier" wrote:

How are these other features added to the chart?

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


"Steen" wrote in message
...
Hi Jon

That did the job - shame on me for not seeing this my self :-)

All how this just lead to the next problem - the change of scale
didn't
work
like I supposed. The timescale is changed allright, but some of
the
information (vertical deadlines and budget lines) get messed up,
when
changing view :-(

It's a bit difficult to explain but thanks for the help so far.

/steen

"Jon Peltier" wrote:

You didn't hint at where the code stops, or what error messages
you
saw.

One thing I noticed: Change this (and related statements):

StartDate = Range(i2)

to

StartDate = Range("i2").Value

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


"Steen" wrote in message
...
Hi

Can anyone help me gette the below code working - novice VB
programmer
:-)

I want the scale of Graph 1 and 2 to change each time the value
in
row
2
and
col 4 changes. Min and Max scacle Ã*s set in i2 and i4 when
changing the
above
value.

Any help would be appriciated.

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim StartDate
'Dim StopDate
'
' If Target.Row = 2 And Target.Column = 4 Then
' StartDate = Range(i2)
' StopDate = Range(i4)
'
' With ActiveSheet.ChartObjects("Chart
1").Chart.Axes(xlCategory)
' .MinimumScale = StartDate - 7
' .MaximumScale = StopDate +7
' End With
'
' ' With ActiveSheet.ChartObjects("Chart
2").Chart.Axes(xlCategory)
' ' .MinimumScale = StartDate - 7
' ' .MaximumScale = StopDate + 7
' 'End With
'
' End If
'End Sub












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
Scaling Multiple Graphs At the Same Time [email protected] Charts and Charting in Excel 4 April 8th 08 05:21 AM
Automatic Graphs/ Dynamic Graphs DanielWalters6 Charts and Charting in Excel 1 January 24th 06 09:29 PM
Scaling for printing chris100[_5_] Excel Programming 7 July 19th 05 10:14 AM
Scaling of graphs through formulas Hari Prasadh Charts and Charting in Excel 4 July 12th 05 05:40 AM
Scaling TAM Excel Programming 1 May 23rd 04 09:01 PM


All times are GMT +1. The time now is 04:27 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"