Results 1 to 6 of 6

The number of a data point in a series

Threaded View

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    Hoganas
    MS-Off Ver
    Excel 2003
    Posts
    5

    Question The number of a data point in a series

    Assume this:
    I have plotted XY data in a chart. Call the value series 'MySeries', and assume its "SeriesCollection" number is 20.
    If, in a VisualBasic macro, I do this:

    Sheets("MyGraphs").Select
    ActiveChart.SeriesCollection(20).Points(84).Select
    the 84-th point in 'MySeries' in the chart on sheet 'MyGraphs' is selected.

    But how do I do "the reverse"?
    I.e. assume I select a point in the plot of 'MySeries' on the chart on sheet 'MyGraphs', how do I get the number in the data series 'MySeries'?
    Assume the sheet "MyData" contains 3 columns:
    The X-values of 'MySeries'
    The Y-values of 'MySeries'
    A comment to each XY pair
    Let's assume I have created a button in or close to the graph area. I want the service handler to this button, in sheet "MyGraphs",
    to select sheet "MyData" and the comment cell on the row where the X and Y for the selected point are.
    This will require a function we could call


    getNumberInSeries(SelectedPt as Point) As Integer
    The procedure would be like (of course there is "Dim SelectedPoint As Point", "Dim PointNumber As Integer" in the declaration section):
       Set SelectedPoint = Selection
       PointNumber = getNumberInSeries(SelectedPoint)
       ...
    What could 'getNumberInSeries' look like?
    Last edited by jeffreybrown; 10-16-2012 at 09:26 AM. Reason: Please use code tags...Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1