+ Reply to Thread
Results 1 to 6 of 6

How to autoscale chart Y-Axis using VBA

  1. #1
    Registered User
    Join Date
    02-27-2014
    Location
    Taipei
    MS-Off Ver
    Excel 2003
    Posts
    24

    How to autoscale chart Y-Axis using VBA

    a_Y-Axis auto scale.zip

    How to autoscale chart using VBA, so i can maximize the viewable area without using the default format axis on chart each time i paste new data to the table,

    Thank you

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: How to autoscale chart Y-Axis using VBA

    Hi mrprofit,

    The following Macros may help you.
    Before you run the Macros you MUST click on a Chart to make it the Active Chart.
    Runtime errors may occur if certain resources are not available (such as the secondary axis).
    Comment out any line that causes a runtime error.

    Lewis

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-27-2014
    Location
    Taipei
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: How to autoscale chart Y-Axis using VBA

    Thank you for the help, how to make this code autoscale by data in a cell / range

    Please Login or Register  to view this content.

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

    Re: How to autoscale chart Y-Axis using VBA

    you can check the present of the axis before trying to read or write properties to avoid errors

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

  5. #5
    Registered User
    Join Date
    02-27-2014
    Location
    Taipei
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: How to autoscale chart Y-Axis using VBA

    Please Login or Register  to view this content.
    is this the line to put it in?

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

    Re: How to autoscale chart Y-Axis using VBA

    You need to include an end if

    Please Login or Register  to view this content.

+ 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. Scientific Notation Y Axis Autoscale Problem
    By Greg212 in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 09-16-2012, 06:04 AM
  2. VBA Code to AutoScale Charts by Chart Name
    By WVinVA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2012, 01:35 PM
  3. Autoscale line chart
    By schnett in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-03-2010, 09:31 PM
  4. [SOLVED] Disable AutoScale for X and Y Axis
    By Jennifer Q in forum Excel General
    Replies: 3
    Last Post: 04-19-2006, 02:45 PM
  5. [SOLVED] [SOLVED] Can a value axis autoscale to something other than 0 for the min?
    By jthimagesolutions in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-08-2006, 12:45 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