+ Reply to Thread
Results 1 to 7 of 7

Named Range in a chart.

  1. #1
    Registered User
    Join Date
    03-14-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Named Range in a chart.

    Hi There,

    This might be an easy question, but is it possible to have named range in quotes?

    For example the code below selects a range in a chart based on a users selection:

    Please Login or Register  to view this content.
    If however, I had a named range called 'Category' which referred to $B$10:$B$19, and a named range called 'Sales' which referred to $AE$10:$AN$19, is it possible to replicate the above code, so essentially it would look something like:

    Please Login or Register  to view this content.
    The problem with the above is that it does not just select $B$10:$B$19 & $AE$10:$AN$19 - it also selects every column in between. So column C, D, E etc... are also selected.

    The only difference between the codes above are the quotation marks. Is it possible to use quotation marks with named ranges, or is there another way completely?

    Thanks for any help in advance.

    Ashley
    Last edited by revenge4ash8; 12-15-2014 at 08:32 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,099

    Re: Named Range in a chart.

    Try this
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-14-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Named Range in a chart.

    Hi Andy,

    Many thanks for the reply.

    Unfortunately when I try

    ActiveChart.SetSourceData Source:=union(range("category"), range("timeperiods"))
    I receive the following error:

    "Run-time error '1004':

    Method 'Range' of object '_Global' failed".

    Any ideas?

    Thanks again for the help.

    Ashley

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,099

    Re: Named Range in a chart.

    post example file so we can see the named ranges and your chart code

  5. #5
    Registered User
    Join Date
    03-14-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Named Range in a chart.

    Hi Andy,

    I have attached an example of the chart & code that I'm currently using, which will hopefully make things clearer.

    If you have any questions fire away.

    Thanks for the help, I really appreciate it!

    Ashley
    Last edited by revenge4ash8; 12-15-2014 at 08:58 AM.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,099

    Re: Named Range in a chart.

    Change the line
    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-14-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Named Range in a chart.

    Andy that worked perfectly!!

    I can't thank you enough, I've been stuck on this problem for ages!!!

+ 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] How do I use a named range as my chart title?
    By Aland2929 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-18-2013, 01:56 AM
  2. Named Range In Chart
    By simmo86 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-26-2009, 07:44 AM
  3. [SOLVED] Can't chart dynamic named range??
    By Lew_Cousineau@yahoo.com in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-20-2006, 03:35 PM
  4. Using a named range in a chart
    By THOMAS CONLON in forum Excel General
    Replies: 4
    Last Post: 06-27-2006, 09:25 PM
  5. [SOLVED] Can I use named range in data range box when creating pie chart?
    By BJackson in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-17-2005, 01:05 PM

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