+ Reply to Thread
Results 1 to 4 of 4

Setting Major Unit in Chart- can they be set individually

  1. #1
    Registered User
    Join Date
    11-25-2008
    Location
    washington
    Posts
    24

    Setting Major Unit in Chart- can they be set individually

    I am running a macro to reset the scales of a chart. I'm running into a problem when I have a negative number. I would like to have the following major units on the secondary axis(100%, 80%, 60%, 40%, 20%, and 0% or a negative % if applicable). As I have it now, the negative number causes the major units to adjust down to 97%, 77%, 57%, 37%, 17%, and -3%. is there a way to set the major units separately or another way to change this with VBA. Attached is the file with macro.
    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,438
    You will need to round your values to the nearest 20%

    K8: =CEILING(MAX(F2:F11),0.2)
    N8: =IF(MIN(E2:E11)<0,-CEILING(ABS(MIN(E2:E11)/E12),0.2),0)

    Or do it to 10% and adjust the Major value to 10%
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-25-2008
    Location
    washington
    Posts
    24
    When I put those formulas in, my line graph now only aligns with the secondary axis and not the primary axis. And the bar graphs don't align with the secondary axis. Any way to resolve that? The minimum seems to be throwing this off when it's set at -20%

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,438
    If you want it to align then have a look at this page.

    http://peltiertech.com/Excel/Charts/AlignXon2Ys.html

+ 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