+ Reply to Thread
Results 1 to 2 of 2

Specific XY datapoints in graph

  1. #1
    Metin
    Guest

    Specific XY datapoints in graph

    Hi all,

    I have created a chart. Now I want to search for specific cell values in
    Column A, and use the data which belongs to this selection in column C as x
    value, and the data in column F as y value. With VBA.

    Example:
    A B C D E F
    1 A23C R2 65 17 26 119
    2 A23Q R2 44 25 24 128
    3 WT R2 49 8 10 145
    4 A23M R2 54 19 18 98
    5 WT R2 61 7 11 149

    In column A the sample ID is presented. I need to select the rows wich have
    the text 'WT' in column A. From this selection I want to use the data in
    column C as x value and the data in column F as y value (xValue = C3 and C5)
    (yValue = F3 and F5).
    I have made the next macro, but it's not working.

    Sub Testi_1()
    Set wks = Worksheets("Calculated Data")

    v = 2
    w = 5
    For i = 1 to 3
    exSh.Select
    Set rng = Range("C2:S97")
    xWT = Range(rng, "WT", rng.Offset(0, v))
    yWT = Range(rng, "WT", rng.Offset(0, w))
    ActiveChart.SeriesCollection(3).XValues = xWT
    ActiveChart.SeriesCollection(3).Values = yWT
    ActiveChart.SeriesCollection(3).Name = "=""ASP Reference samples"""

    v = v + 1
    w = w + 1
    Next
    End Sub



  2. #2
    Markus Scheible
    Guest

    Specific XY datapoints in graph

    Hi Metin,

    see my answer to that post within the charting newsgroup
    and please try avoiding cross-posts!

    Best

    Markus


    >-----Original Message-----
    >Hi all,
    >
    >I have created a chart. Now I want to search for specific

    cell values in
    >Column A, and use the data which belongs to this

    selection in column C as x
    >value, and the data in column F as y value. With VBA.
    >
    >Example:
    > A B C D E F
    >1 A23C R2 65 17 26 119
    >2 A23Q R2 44 25 24 128
    >3 WT R2 49 8 10 145
    >4 A23M R2 54 19 18 98
    >5 WT R2 61 7 11 149
    >
    >In column A the sample ID is presented. I need to select

    the rows wich have
    >the text 'WT' in column A. From this selection I want to

    use the data in
    >column C as x value and the data in column F as y value

    (xValue = C3 and C5)
    >(yValue = F3 and F5).
    >I have made the next macro, but it's not working.
    >
    >Sub Testi_1()
    >Set wks = Worksheets("Calculated Data")
    >
    >v = 2
    >w = 5
    >For i = 1 to 3
    >exSh.Select
    >Set rng = Range("C2:S97")
    > xWT = Range(rng, "WT", rng.Offset(0, v))
    > yWT = Range(rng, "WT", rng.Offset(0, w))
    > ActiveChart.SeriesCollection(3).XValues = xWT
    > ActiveChart.SeriesCollection(3).Values = yWT
    > ActiveChart.SeriesCollection(3).Name = "=""ASP

    Reference samples"""
    >
    >v = v + 1
    >w = w + 1
    >Next
    >End Sub
    >
    >
    >.
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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