+ Reply to Thread
Results 1 to 11 of 11

Dynamic Charting Defined Names Issues

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Unhappy Dynamic Charting Defined Names Issues

    Hello!

    I am working on a spreadsheet in which I have a dynamic chart that changes when the user checks a box (form control). The check boxes turn off and on certain columns in the chart. I used the "Define Name" feature and created the various ranges using the Offset function and CountIf function (I have formulas in the blank cells).
    Everything works correctly except that when columns are unchecked (thus removed from the dynamic table), the named ranges do not recognize the column that is now completely blank. This results in a "Invalid Reference" error message every time a box is unchecked and the defined range turns to all blank cells.

    Does anyone know what will fix this? Possibly a change in the "Refers to" formula under the define name feature?

    If that is too confusing I can attempt to clarify further.

    Thanks for your help in advance!

    Drew

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

    Re: Dynamic Charting Defined Names Issues

    If you use named ranges the reference must be valid to avoid the error message.
    So even if the UI means nothing should be display you need to return a reference that is vaild, you could point to a single empty cell.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    04-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Dynamic Charting Defined Names Issues

    Andy,
    Thanks for responding!

    That makes sense that I need a valid reference. The problem is that when the box is checked, all references are valid, however, when my check boxes are not checked, the reference turns invalid.

    I am not sure if I understand your suggestion to use a single cell. Could you elaborate?

    Thanks,

    Drew

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

    Re: Dynamic Charting Defined Names Issues

    I assume that when no checkboxes are selected the named range returns an invalid reference, hence the problem.

    You need to alter you named range formula so that a invalid reference is not returned. Instead return a reference to a single empty cell so the chart has something to display.

    If you need more help post workbook example.

  5. #5
    Registered User
    Join Date
    04-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Dynamic Charting Defined Names Issues

    The problem with this is that I have 15 columns and the check boxes turn off single columns. When a box is unchecked I do not want that column to appear on my chart at all.

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

    Re: Dynamic Charting Defined Names Issues

    Then named ranges will not work. They control where and how much data to display.

    If you don't want data displayed at all, including the legend and columns resizing, then you will need to hide the data source.

  7. #7
    Registered User
    Join Date
    04-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Dynamic Charting Defined Names Issues

    Okay, that makes sense. Would I accomplish this by creating a macro to hide the columns that are unchecked?

    Thanks, you have provided much help!

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

    Re: Dynamic Charting Defined Names Issues

    The macro would toggle the column between hidden and visible depending upon the checkbox value.

    Make sure the chart is set to not display hidden cells. And is the chart is position over the changing cells that it does not move and size with cells.

  9. #9
    Registered User
    Join Date
    04-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Dynamic Charting Defined Names Issues

    Okay, could you give me an example of this macro? I had some luck with getting it to work on the same sheet, but not over multiple sheets
    I need the check box on Sheet1 to hide column I:I on Sheet2.
    Thanks!

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

    Re: Dynamic Charting Defined Names Issues

    as suggested before, post example workbook.

    You can also try using the macro recorder.

  11. #11
    Registered User
    Join Date
    04-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Dynamic Charting Defined Names Issues

    Thanks, I was able to get it working. You have been a large help. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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