+ Reply to Thread
Results 1 to 7 of 7

change chart source data bssed on a cell's value

  1. #1
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    change chart source data bssed on a cell's value

    If cell A1 equals 3, then the graph source data range is B1:D5. If A1 equals 7, the the graph source data is B1:D10.
    Can this be done?
    (I have a graph of initial investment and then the yearly change based on annual fees. This project goes for 7 years, but I like to use the same graph if the project only lasts 3 years.
    Thanks!
    leaning

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: change chart source data bssed on a cell's value

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to Quick Post button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

  3. #3
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: change chart source data bssed on a cell's value

    Here's the file. What I'd like is to just use one set of axis and display either the three year or the 7 year data.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: change chart source data bssed on a cell's value

    I could see a filter doing this: http://www.wikihow.com/Use-AutoFilter-in-MS-Excel
    Or I could see doing this with a dynamic named range: http://peltiertech.com/dynamic-charts/

    Which approach do you want to pursue? Where do you get stuck?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: change chart source data bssed on a cell's value

    Mr Shorty,

    1) I want to lock the sheet.
    2) User inputs a 3 or a 7.
    3) User inputs initial investment
    4) User inputs total annual fees (those will remain constant over the 3 or 7 year period.)

    Those three inputs should be enough to draw a line.

    Then the graphs get created without the user having to select cells or manually apply a filter.

    Maybe even show both graphs and if the input is 3, hide the 7 graph, and reverse if the input is 7.

    HTH.

    leaning

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: change chart source data bssed on a cell's value

    Did you try using dynamic named ranges? It seems like that should work, even on a protected sheet.

  7. #7
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: change chart source data bssed on a cell's value

    Mr. Shorty,

    I got it to work like I want.

    I just changed the chart type to "Scatter with Smooth Lines".

    Now, there's just the three unlocked cells the user fills out, and then the chart automatically adjusts to show 3 or 7 years.

    Thanks for your help!

    leaning
    Attached Files Attached Files
    Last edited by leaning; 10-11-2016 at 01:37 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change chart source data range
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2015, 10:51 AM
  2. Change Chart Source Data series by changing cell
    By Hendra S in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2014, 02:09 PM
  3. Change source data of chart by adjusting two cell values
    By kadekl in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 10-19-2012, 05:54 AM
  4. how to automatically change source data in a chart?
    By els_pricing_heather in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-29-2011, 10:29 AM
  5. Not able to change Excel chart data source
    By booo in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-21-2010, 02:15 PM
  6. Change Data Source of Pivot Chart
    By riluma in forum Excel General
    Replies: 1
    Last Post: 07-16-2010, 01:25 PM
  7. change Line Chart source data in VB
    By Centurian77 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-20-2005, 12:52 PM

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