• Re: Set chart source data to a named range - how?

    From Arthur Rufus@21:1/5 to Tushar Mehta on Sat Jun 3 11:14:03 2023
    Will this work for Google Sheets?

    On Monday, March 25, 2002 at 12:59:38 PM UTC-5, Tushar Mehta wrote:
    [This followup was posted to microsoft.public.excel.charting with an
    email copy to James Radke.
    Please use the newsgroup for further discussion.]
    I interpreted your problem very differently from Jon or Bernard.
    Suppose on the worksheet that contains the chart, you specify which data sheet you want to use in cell C2. So, if the data are in sheets named Sheet1, Sheet2, and Sheet3, cell C2 will contain the text value
    'Sheet1' or 'Sheet2' or 'Sheet3.'
    Now, define a name such as
    chartRng =INDIRECT("'"&Sheet1!$C$2&"'!A1:A3")
    Plot this. Now, if you change the contents of C2, the graph will adjust automatically.
    For more on how to use a named range in a chart, check the tutorial
    'Dynamic Charts' of my web site.
    --
    Regards,
    Tushar Mehta
    www.tushar-mehta.com
    Microsoft MVP -- Excel
    --
    In <#03lBOR0BHA.2036@tkmsftngp03>, James Radke <jra...@wi.rr.com> wrote
    Hello,

    I must be missing something.. I can't seem to set the source data for a chart to a named range.. is there some trick to this? What do I enter in the Values area?

    I am assuming I can then change the named range with a macro, and the chart will then reflect the new named range.. correct?

    Thanks!

    Jim




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arthur Rufus@21:1/5 to Tushar Mehta on Sat Jun 3 11:13:28 2023
    On Monday, March 25, 2002 at 12:59:38 PM UTC-5, Tushar Mehta wrote:
    [This followup was posted to microsoft.public.excel.charting with an
    email copy to James Radke.
    Please use the newsgroup for further discussion.]
    I interpreted your problem very differently from Jon or Bernard.
    Suppose on the worksheet that contains the chart, you specify which data sheet you want to use in cell C2. So, if the data are in sheets named Sheet1, Sheet2, and Sheet3, cell C2 will contain the text value
    'Sheet1' or 'Sheet2' or 'Sheet3.'
    Now, define a name such as
    chartRng =INDIRECT("'"&Sheet1!$C$2&"'!A1:A3")
    Plot this. Now, if you change the contents of C2, the graph will adjust automatically.
    For more on how to use a named range in a chart, check the tutorial
    'Dynamic Charts' of my web site.
    --
    Regards,
    Tushar Mehta
    www.tushar-mehta.com
    Microsoft MVP -- Excel
    --
    In <#03lBOR0BHA.2036@tkmsftngp03>, James Radke <jra...@wi.rr.com> wrote
    Hello,

    I must be missing something.. I can't seem to set the source data for a chart to a named range.. is there some trick to this? What do I enter in the Values area?

    I am assuming I can then change the named range with a macro, and the chart will then reflect the new named range.. correct?

    Thanks!

    Jim



    Will this work for Google Sheets?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)