+ Reply to Thread
Results 1 to 3 of 3

VBA for changing the x-axis bounds in a graph

  1. #1
    Registered User
    Join Date
    01-06-2015
    Location
    Houston, Texas
    MS-Off Ver
    2013
    Posts
    6

    VBA for changing the x-axis bounds in a graph

    I have no experience with VBA so please consider that with any responses. (Document is attached)

    I would like to create a macro that is activated with a button in "Snapshot Data" that changes the bounds of the chart sheet called “Snapshot”. As you can see from the graph the default bounds leave a lot of gap on both sides of the chart. I would like the bounds to be whatever number I define in “K19” and “K20”, in this case 2% above and below the min and max, respectively.

    The code could be written to exclude the reference to a particular cell also as long as an explanation on how I would change that percent up or down is given (I don’t know that 2% is exactly what I want just yet)

    On the actual document there are several other lines of data than cost per day that have a wide range requiring me to switch the boundaries manually often during presentations.

    Any help would be appreciated!
    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,482

    Re: VBA for changing the x-axis bounds in a graph

    add a button and assign following macro.

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

  3. #3
    Registered User
    Join Date
    01-06-2015
    Location
    Houston, Texas
    MS-Off Ver
    2013
    Posts
    6

    Re: VBA for changing the x-axis bounds in a graph

    I would rather risk double responding then taking a chance of not thanking you. The info you provided worked out perfectly, thank you!

+ 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. Changing X axis scale outwards from middle of graph via line
    By FHstudent in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 07-23-2014, 12:22 PM
  2. Replies: 10
    Last Post: 10-07-2013, 11:41 AM
  3. Replies: 8
    Last Post: 02-12-2009, 10:12 AM
  4. Graph with changing number of points on X-axis
    By blurtoad in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-19-2007, 10:07 AM
  5. can I make the vertical axis the category axis in Excel line graph
    By power1 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-20-2006, 04:50 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