Consulting

Results 1 to 2 of 2

Thread: Sleeper: Chart with user-defined range

  1. #1
    VBAX Regular
    Joined
    Apr 2012
    Posts
    14
    Location

    Sleeper: Chart with user-defined range

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Here is one way
    Attached Files Attached Files
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •