+ Reply to Thread
Results 1 to 3 of 3

Charts - Macro - (Axis are not coming up good)

  1. #1
    Forum Contributor
    Join Date
    09-05-2013
    Location
    Malta
    MS-Off Ver
    Excel 2016
    Posts
    103

    Charts - Macro - (Axis are not coming up good)

    Hi.. i have a sheet with sales data.. with the years from 2004 to 2013.
    Certain clients do not have any values in certain years, but when i run the macro, the years are messed up on the chart.

    See attached doc. 'CLIENT A' is incorrect; 'CLIENT B' is correct (as in showing all the years). But for some reason it is picking up a value for 2004. (which is incorrect) What am I doing wrong?

    Thanks
    Sam
    Attached Files Attached Files

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

    Re: Charts - Macro - (Axis are not coming up good)

    You need to use the correct start and finish cells.

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

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Charts - Macro - (Axis are not coming up good)

    The source data for the three charts is not correct. For some reason (that I don't know why), Excel automatically truncated the data range to omit the leading bank values even though you had coded the proper data range e.g.; you coded a data range of B2:K2 and Excel automatically adjusted that to J2:K2 to omit the leading blank values.

    The code below works around that.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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] loop macro to create different charts by selecting different x-axis data
    By burnmeister in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2013, 10:38 AM
  2. Chart X axis values coming up as black blob
    By joshnathan in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 07-23-2012, 11:47 AM
  3. Macro for auto adjusting axis on charts
    By ExcelNUBs in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-10-2012, 05:24 AM
  4. Y Axis data coming from two workbooks is it possible?
    By toyman_ca in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 01-13-2010, 11:32 AM
  5. Replies: 0
    Last Post: 05-16-2006, 09:18 AM

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