+ Reply to Thread
Results 1 to 2 of 2

Auto Adjust of Primary and Secondary Axis Bounds

  1. #1
    Registered User
    Join Date
    11-12-2019
    Location
    New York
    MS-Off Ver
    2016
    Posts
    16

    Question Auto Adjust of Primary and Secondary Axis Bounds

    Hello all,

    I'm looking for a way to auto adjust the primary and secondary y-axis bounds in my line chart. When excel auto adjust the bounds it always selects 0 as the lower bound, which effectively makes the chart useless since all of the "action" is happening in the millions; To complicate things a bit further, I have a slicer that allows users to drill down to a more specific data point which means that both y-axes need to be dynamic.

    I've used a vba to auto adjust the axis value with only one y-axis and all I'm finding online are solutions on how to set the same max/min values for the primary and secondary y-axis, but I am looking for a solution that will allow different dynamic max/min ranges for both y-axes

    Thanks in advance

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

    Re: Auto Adjust of Primary and Secondary Axis Bounds

    Sounds like you already have the code required and you just need to understand the correct values to use,

    The axes object can take 2 arguments.

    Axes([Type], [AxisGroup As XlAxisGroup = xlPrimary])

    The first is Type, which can be xlValue, xlCategory, or xlSeriesAxis (xlSeriesAxis is valid only for 3D charts)
    On a xyscatter chart the X axis (horizontal) can be referenced using the xlCategory enum.

    The second argument is the axis group, which can be xlPrimary or xlSecondary
    Cheers
    Andy
    www.andypope.info

+ 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. pivot with primary axis 2 tables as input and secondary axis the same unit?
    By Johan Tielens in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-19-2020, 04:52 PM
  2. [SOLVED] Primary Axis & secondary Axis have high gap to show in chart
    By leakhna in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-05-2018, 02:19 AM
  3. Replies: 2
    Last Post: 10-08-2014, 08:04 PM
  4. Replies: 1
    Last Post: 10-08-2014, 06:36 PM
  5. Replies: 4
    Last Post: 05-17-2012, 11:25 AM
  6. Replies: 6
    Last Post: 12-07-2010, 02:54 PM
  7. Replies: 1
    Last Post: 05-03-2006, 09:20 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