+ Reply to Thread
Results 1 to 2 of 2

Bar Graph Structure incorrect after Macro

  1. #1
    Registered User
    Join Date
    09-08-2018
    Location
    Prescott, WI
    MS-Off Ver
    365
    Posts
    36

    Question Bar Graph Structure incorrect after Macro

    Quote Originally Posted by dflak View Post
    Forget the VBA and go with Excel Tables. I converted your data range in columns B:D into an Excel table. Tables have several advantages:

    1. They know how big they are, so formulas, pivot tables and charts built off them always reference the right amount of data.
    2. They remember and copy down formulas, formats, validations, etc. automatically.

    I added a helper column for Month.

    I overlaid the table with named dynamic ranges:
    Plot_Calls =OFFSET(Plot_Date,0,1)
    Plot_Chat =OFFSET(Plot_Date,0,2)
    Plot_Date =OFFSET(X!$B$68,0,0,COUNTA(X!$B:$B)-1,1)

    I used these dynamic ranges as the data sources for the chart.

    Here are a couple of wikis that describe named dynamic ranges and how to use them in charts:
    http://www.utteraccess.com/wiki/Offs...Dynamic_Ranges
    http://www.utteraccess.com/wiki/Dynamic_Charting

    Finally I added a slicer to the table (do a web search on them - they are fancy filters that are easy to implement and are very powerful).

    All of this is built-in Excel.

    P.S All you have to do is add in the next date (12/27/2018) on the next line in the table and the formulas in Columns C and E will be replicated automatically and the dynamic range will add the date to the end of the chart.

    I'm not sure how to word this but I have a Macros (one for each Month of the Year) that are used to inform a Graph's Data. They are Structured exactly the same, the only thing that changes are the Cells they reference. It works Great for the OCT and NOV Macros, however past that, the Bar Graph is interperetting the data incorrectly.

    EXAMPLE:
    NOVEMBER (CORRECT)

    Please Login or Register  to view this content.
    NOV CORRECT.PNG


    DEC INCORRECT
    Please Login or Register  to view this content.
    DEC INCORRECT.PNG

    Any Advice would me very much appreciated! Thank you!
    Attached Files Attached Files
    Last edited by Bryan.Pagenkopf; 01-02-2019 at 09:35 AM.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Bar Graph Structure incorrect after Macro

    Absent a workbook, I'd just suggest you explicitly set the values and xvalues for the 2 series in the chart instead of use setsourcedata.
    Rory

+ 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] Forumula Results Incorrect when data missing. Wanting to hide the incorrect formula.
    By firemedic6265 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-05-2014, 05:01 PM
  2. Creating a Pyramid Hierarchy structure from a flat structure
    By thegamerulez in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2014, 01:28 AM
  3. Excel 2010 - Incorrect Axis on Graph
    By Todd_Woods in forum Excel General
    Replies: 2
    Last Post: 04-16-2012, 10:06 AM
  4. incorrect result of graph
    By Lorna B in forum Excel General
    Replies: 2
    Last Post: 03-30-2012, 11:11 AM
  5. 100% stacked column graph (incorrect proportions)
    By rvc81 in forum Excel General
    Replies: 2
    Last Post: 12-14-2011, 05:01 AM
  6. Macro that can search folder structure
    By Traymond in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-08-2011, 07:11 PM
  7. formula structure in a macro
    By cdl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2008, 12:04 PM
  8. Directory Structure in a Macro
    By davehunter in forum Excel General
    Replies: 1
    Last Post: 06-20-2007, 12:59 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