Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Variable time scaling for different views in a graph

Hi,
I need to know, if it is possible to set the x-Axis of a graph with variable
values.

Example:
I have a projekt running over 3 Years. I would like to have 2 views. First
one is over the complete project duration, second one is only the current
year.

As far as I know, I can only set the scale automatically or manual. In
manual mode the is no variable value or cell exepted.

Is there any idea out there to help me out?
Thanks, Matz
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Variable time scaling for different views in a graph


Matz,

You can do this using VBA as follows

If you enter your start date in Cell A1, and End Date in A2

you can then use a macro to use these values in the scale:

'set start and end dates
uvStart = Format(Range("A1").Value, "##")
uvEnd = Format(Range("A2").Value, "##")

'set Axes values to styart and end dates
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = uvStart
.MaximumScale = uvEnd
End With

I have assumed that your chart is called "Chart 1". You can change the
code as required for chart name or location of you dates

I hope this helps

Steve

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Variable time scaling for different views in a graph

Great help! Thanks!
After I have found out how to write a Macro in VBA it worked in principle.
Now I have to do some details.
Happy so far :-) Matz

"SIR Knight" wrote:


Matz,

You can do this using VBA as follows

If you enter your start date in Cell A1, and End Date in A2

you can then use a macro to use these values in the scale:

'set start and end dates
uvStart = Format(Range("A1").Value, "##")
uvEnd = Format(Range("A2").Value, "##")

'set Axes values to styart and end dates
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = uvStart
.MaximumScale = uvEnd
End With

I have assumed that your chart is called "Chart 1". You can change the
code as required for chart name or location of you dates

I hope this helps

Steve


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Variable time scaling for different views in a graph

You can also do this without VBA using dynamic ranges:

http://pubs.logicalexpressions.com/P...cle.asp?ID=246

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


"SIR Knight" wrote in message
ps.com...

Matz,

You can do this using VBA as follows

If you enter your start date in Cell A1, and End Date in A2

you can then use a macro to use these values in the scale:

'set start and end dates
uvStart = Format(Range("A1").Value, "##")
uvEnd = Format(Range("A2").Value, "##")

'set Axes values to styart and end dates
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = uvStart
.MaximumScale = uvEnd
End With

I have assumed that your chart is called "Chart 1". You can change the
code as required for chart name or location of you dates

I hope this helps

Steve



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
Variable time calculation Issam LAdki New Users to Excel 6 April 7th 05 04:05 PM
unmet challenge boris Excel Worksheet Functions 2 March 16th 05 02:13 PM
Excel sheet for workout jogging time and graph Trevor New Users to Excel 1 March 7th 05 03:54 PM
Time axis column and scatter/line graph kraymond Charts and Charting in Excel 5 February 8th 05 11:34 PM
xy scatter graph with a scrolling time element Brad Charts and Charting in Excel 2 January 7th 05 01:53 PM


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