+ Reply to Thread
Results 1 to 12 of 12

Error when trying to Create Dynamic Chart with named ranges

  1. #1
    Registered User
    Join Date
    07-16-2014
    Location
    Seattle, WA
    MS-Off Ver
    Office 365
    Posts
    67

    Angry Error when trying to Create Dynamic Chart with named ranges

    I have made charts with named ranges before, I can't figure out why I keep getting the incorrect reference error when I try to add my named ranges to the data series.

    In the attached spreadsheet I have tried creating a chart with the series as

    ='Dynamic_Chart.xlsx'!A

    to plot the A series but it doesn't work and I can't figure out why. Any help would be much appreciated!

    Thanks,
    Kelsey
    Attached Files Attached Files

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Error when trying to Create Dynamic Chart with named ranges

    Unless "'Dynamic_Chart,xlsx" is a sheet name, your syntax is in error. Workbooks are enclosed in brackets.
    Please Login or Register  to view this content.
    might be a better expression.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,417

    Re: Error when trying to Create Dynamic Chart with named ranges

    Possibly the INDIRECT it doesn't like. Maybe try it like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by TMS; 03-07-2019 at 04:36 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    07-16-2014
    Location
    Seattle, WA
    MS-Off Ver
    Office 365
    Posts
    67

    Re: Error when trying to Create Dynamic Chart with named ranges

    Thanks JLGWhiz for the reply! I tried your solution with brackets with no luck. I also tried without adding the sheet name since these named ranges are available to the entire workbook and it also didn't work. Is it working on your end with this solution?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,417

    Re: Error when trying to Create Dynamic Chart with named ranges

    Mmmm ... have you tried my suggestion?

  6. #6
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Error when trying to Create Dynamic Chart with named ranges

    Quote Originally Posted by kelseygueldalewis View Post
    Thanks JLGWhiz for the reply! I tried your solution with brackets with no luck. I also tried without adding the sheet name since these named ranges are available to the entire workbook and it also didn't work. Is it working on your end with this solution?
    I didn't try that but I did test the range for the series and it appeared to be OK. Maybe @TMS is onto something.

  7. #7
    Registered User
    Join Date
    07-16-2014
    Location
    Seattle, WA
    MS-Off Ver
    Office 365
    Posts
    67

    Re: Error when trying to Create Dynamic Chart with named ranges

    Quote Originally Posted by TMS View Post
    Mmmm ... have you tried my suggestion?
    I am playing around with it now, your solution had a fixed beginning of the range but mine needs to be dynamic, going back 12 entries as the weeks go by but I think this is on the right track. I will post if I solve by removing the indirect.

  8. #8
    Registered User
    Join Date
    07-16-2014
    Location
    Seattle, WA
    MS-Off Ver
    Office 365
    Posts
    67

    Re: Error when trying to Create Dynamic Chart with named ranges

    I'm stuck on trying to get the origin cell reference used in the OFFSET formula of my named range without using indirect. I am using the current date as the last value in the named range, and in A15 calculating what column number corresponds to this date. I'm not sure how to do this without indirect.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,417

    Re: Error when trying to Create Dynamic Chart with named ranges

    This:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,417

    Re: Error when trying to Create Dynamic Chart with named ranges

    Or, if you want to miss out the "middle man" ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    07-16-2014
    Location
    Seattle, WA
    MS-Off Ver
    Office 365
    Posts
    67

    Re: Error when trying to Create Dynamic Chart with named ranges

    Quote Originally Posted by TMS View Post
    Or, if you want to miss out the "middle man" ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Yes this worked! Thank you! I will update my formulas accordingly

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,417

    Re: Error when trying to Create Dynamic Chart with named ranges

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Need Macro to Create Dynamic Named Ranges
    By qwertyyy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-11-2023, 04:32 AM
  2. [SOLVED] Dynamic Named Ranges used create a Chart
    By sdingman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2017, 10:13 AM
  3. Create two dynamic named ranges in the same column?
    By nobodyukno in forum Excel General
    Replies: 1
    Last Post: 05-05-2017, 11:10 AM
  4. Quickly Create 100+ Dynamic Named Ranges
    By dharmon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-17-2016, 05:13 PM
  5. [SOLVED] dynamic chart with named ranges
    By a.hudrea in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2014, 05:18 AM
  6. Dynamic Chart Using Named Ranges
    By jjcgirl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2013, 11:57 AM
  7. Chart using dynamic named ranges
    By sinspawn56 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-05-2010, 10:39 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