View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Matz Matz is offline
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