PDA

View Full Version : Sleeper: Chart with user-defined range



Andrew01
04-25-2012, 05:30 AM
Hi All,
I'm trying to create a simple line chart which plots time against Price. Time is in column J and Price is in column L. However, I need the user to be able to define over which range of times the chart should plot( eg start time and end time). The chart code is straight forward (Just need to reference range):


Private Sub cmdPriceChart_Click()
Dim StartTime As Date
Dim EndTime As Date
StartTime=Range("A10")
EndTime=Range("B10")
Charts.Add ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData Source:='Enter Range'
End Sub

I would really appreciate any ideas.

Bob Phillips
04-25-2012, 08:37 AM
Here is one way