Consulting

Results 1 to 5 of 5

Thread: Vertical like through point

  1. #1
    VBAX Regular
    Joined
    Sep 2007
    Posts
    14
    Location

    Vertical like through point

    Hi i have some data that i have graphed.
    ex.
    x axis, y axis
    800, 40
    900,41
    1000,42
    1100, 39
    1200, 38
    1300, 37
    so i want to make a vertical line through the lowest x value, highest x value and also a third value which you can think of as the midpoint value.
    so i used the min, max etc commands to put the values of 1300, 1000 and 11000 in to cell A7, A9 and A11

    is there a macro that will refer to these cells and make a vertical line on my graph through each of these x values?
    also i need to color the vertical line red for the value in cell a7, green for the x value in cell a11 and red for the x value in cell a9.

    i need to do this hundreds of time because i have hundreds of data sets so i though running a macro for each data set would be a lot easier and nicer than using the draw tool.


    thank you

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Can you post a small sample of your data with 3 charts?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Regular
    Joined
    Sep 2007
    Posts
    14
    Location
    Hi
    I have attached an excel file with sample.

    Thank you!

  4. #4
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    You can create the vertial lines using Y error bars.

    You will need to plot a series for each coloured line.
    This can be done with formula.

    You will also need to fix both the max and min value of the Y axis in order for the error bars to reach the edge of the plot area.
    Cheers
    Andy

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Thanks Andy,
    I hoped you would pop in!
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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