+ Reply to Thread
Results 1 to 7 of 7

VBA chart: scale giving strange months

  1. #1
    Registered User
    Join Date
    11-05-2007
    Posts
    4

    VBA chart: scale giving strange months

    hi

    tried to be concise in the the title not sure if it makes sense!

    anyway i'll try again.

    i have attached a pic to show more clearly, i am outputting charts from vba and they are giving me a problem with the x-axis scale. all the months are fine except when i get to august - 08 it calls it july - 08.

    when i hold the cursor over the data point it correctly says aug - 08 point, but on the axis and display it show july - 08, so 2 july - 08's next to each other. i have messed around with the code for hours to try to get it to change and its driving me mad as i have done so many charts and so much code i cant afford the time to go and start again (even though i know this would probably fix it, damn computers!). anyone seen it before or have any ideas on how to fix this?

    any help much appreciated.
    thanks

    steve
    Attached Images Attached Images

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    The picture isn't much help. Can you post a spreadsheet?

  3. #3
    Registered User
    Join Date
    11-05-2007
    Posts
    4
    the spreadsheet is a touch large. is this any better? i've left the cursor over the rogue point and you can see it is recognised as aug - 08 but the axis says july - 08.

    thanks
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    11-05-2007
    Location
    Pune, India
    Posts
    51
    Quote Originally Posted by steve@work
    the spreadsheet is a touch large. is this any better? i've left the cursor over the rogue point and you can see it is recognised as aug - 08 but the axis says july - 08.

    thanks
    Hi Steve,

    First of all, its very difficult to get the cause because we cannot trace the axis in an image. If you can only embed the chart in a new worksheet and attach it here...it would be really helpful. Or, just double click the X Axes, and paste the screenshot of the Scale...we can give it a try!

    Thanks,
    Vikas

  5. #5
    Registered User
    Join Date
    11-05-2007
    Posts
    4
    Quote Originally Posted by vikasbhandari
    Hi Steve,

    First of all, its very difficult to get the cause because we cannot trace the axis in an image. If you can only embed the chart in a new worksheet and attach it here...it would be really helpful. Or, just double click the X Axes, and paste the screenshot of the Scale...we can give it a try!

    Thanks,
    Vikas
    sorry, cant get the whole file here or just the chart embedded in a new one as its full of stupid vba. i'm by no means an expert so the code is a mess which is probably what is causing it.

    i have attached a screenie of the scale tab, i have messed around with this and got rid of the extra july by making max scale equal to 39800 but this messes correlation of the axis with the line up.

    i might just get my pencil and paper out in a minute!

    thanks for your time.
    Attached Images Attached Images

  6. #6
    Registered User
    Join Date
    11-05-2007
    Location
    Pune, India
    Posts
    51
    Quote Originally Posted by steve@work
    sorry, cant get the whole file here or just the chart embedded in a new one as its full of stupid vba. i'm by no means an expert so the code is a mess which is probably what is causing it.

    i have attached a screenie of the scale tab, i have messed around with this and got rid of the extra july by making max scale equal to 39800 but this messes correlation of the axis with the line up.

    i might just get my pencil and paper out in a minute!

    thanks for your time.
    Just a quick question then, do you have any secondary axes in your chart!!! You can do one thing....open your file...open another excel window...copy the chart, and then paste it in the another window....save that new workbook and attach here....

    The problem which I can think is that...your axis is scaled on a number format....just try these steps:

    Double click on the X Axis Dates...goto Tab Number--> Make sure that your format is set to Date, not any custom types. After setting the date format, if you will go to Scales tab, it should look like the screen in the attachment. then select all checkboxes, which means select all items to auto(eg Maximum, Minimum, Major Unit etc. all shud be auto). Then uncheck the unit option and put the 1 Month as Major and Minor Unit....it should solve the problem.

    The exact problem here is that, your Axes is not a date axis, that is why the gap in between the two tick mark is not a month...but 30 days....It is causing two Numbers... 1 July and 31 July. I have some options to try...but I would actually need the data on which you are working!! Let me know for any other questions.
    Attached Images Attached Images
    Thanks!
    Vikas Bhandari
    http://excelnoob.blogspot.com

  7. #7
    Registered User
    Join Date
    11-05-2007
    Posts
    4
    thanks, changing the cell format helped, glad its wasnt anything drastic!

    thanks for your time!

    steve

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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