+ Reply to Thread
Results 1 to 5 of 5

Axis Labels Range

  1. #1
    Registered User
    Join Date
    12-28-2018
    Location
    bristol
    MS-Off Ver
    bristol
    Posts
    6

    Axis Labels Range

    Hi

    I have created a dynamic chart that updates as I select the date range from a drop down menu.

    Each data series in my chart refers to a named range in my worksheet - the named range is a formula that updates the data range as the drop down is changed

    It works perfectly well - except when I close the worksheet and then re-open it the named range referred to in the axis label range has changed slightly so that it no longer works.

    For example - what it should look like when it works:

    Please Login or Register  to view this content.
    The workbook is called: QuoteCalcs.xlms
    The sheet within the workbook: Parameters

    When I close the worksheet and then reopen it the code changes to the below.

    Please Login or Register  to view this content.
    I have to then manually change [0] to Parameters to get them all to work which defeats the whole purpose

    I am not sure if I need to fix the Parameters sheet within the code - not sure how to do this??

    Any thoughts/comments much appreciated?

    I have also posted this on mrexcel but the suggestion I received didnt work

  2. #2
    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,761

    Re: Axis Labels Range

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    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


  3. #3
    Registered User
    Join Date
    12-28-2018
    Location
    bristol
    MS-Off Ver
    bristol
    Posts
    6

    Re: Axis Labels Range

    Thanks

    I enclose the spreadsheet.

    On the parameters tab is the graph.

    Each data series on the graph refers to a named range. It is this reference to the named range that I want to fix. It seems to change slightly every time I close the spreadsheet which means I need to manually update each named range for each data series in the graph each time I open it.

    Any suggestions very much appreciated as this is really bugging me!
    Attached Files Attached Files
    Last edited by terrytibbs; 02-03-2019 at 03:35 PM.

  4. #4
    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,761

    Re: Axis Labels Range

    After looking at the sample file, my first guess is that the issue is that the Data tab doesn't have all the dates into the future. Hence, when you open the workbook up on a new day, =TODAY()-2 might not exist, and so it doesn't exist in the InterimData tab which is being charted.

    At least that was the issue that I had when I opened your workbook. Excel complained about formula issues on the Parameter sheet and that turned out to be the fact that the dates stopped at the 18 January 2019. Once I realised that and fixed it, the graph looks OK. The Named Range mydatesmy, ='YahooStockQuotes8.xlsm'!mydatesmj, comes out as =INDEX(interimdata!$A:$A,MATCH(Parameters!$E$15,interimdata!$A:$A,0)):INDEX(interimdata!$A:$A,MATCH(Parameters!$E$16,interimdata!$A:$A,0))

  5. #5
    Registered User
    Join Date
    12-28-2018
    Location
    bristol
    MS-Off Ver
    bristol
    Posts
    6

    Re: Axis Labels Range

    Thanks TMS

    Really appreciate your help.

    I make the changes that you suggest but when I close the spreadsheet and reopen it the named range mydatesmj goes from: = 'YahooStockQuotes8.xlsm'!mydatesmj
    To =[0]!mydatesmj.

    Which means it needs to be manually changed to work again - is there anyway to fix YahooStockQuotes8.xlsm'!mydatesmj

    I guess it's because when I close YahooStockQuotes8.xlsm the named range is referring to a closed sheet?

    Thanks

+ 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. How to attribute a relative range for X-Axis Labels in VBA
    By msteilen in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-15-2018, 04:55 PM
  2. [SOLVED] Need graph to show alphanumeric values as Y axis labels with Date as Z axis labels
    By Ochimus in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 06-24-2015, 08:40 PM
  3. Replies: 3
    Last Post: 04-30-2014, 05:57 AM
  4. Replies: 0
    Last Post: 10-19-2012, 11:12 AM
  5. Replies: 6
    Last Post: 04-07-2011, 04:26 AM
  6. Changing individual axis labels on the same axis (vba?)
    By sikey in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-07-2010, 06:08 AM
  7. how to put x axis values in the chart instead of x axis labels
    By Sinclair in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-21-2005, 06:05 AM

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