+ Reply to Thread
Results 1 to 5 of 5

VBA to set Minimum and Maximum Values of X Axis

  1. #1
    Registered User
    Join Date
    03-13-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    19

    VBA to set Minimum and Maximum Values of X Axis

    Hi.

    I have a chart which on X Axis has date values and Y Axis has effort (in man-hrs).
    I want to set the minimum and maximum values of the X-Axis as the first and last date in the chart data.
    Can you please help with VBA code to set these dynamic minimum and maximum X-Axis values.

    Any help would be appreciated.

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

    Re: VBA to set Minimum and Maximum Values of X Axis

    see previous post
    http://www.excelforum.com/excel-char...worksheet.html
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-13-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: VBA to set Minimum and Maximum Values of X Axis

    Andy , this code doesn't seem to work for me

    Attaching my worksheet with the timeline I had prepared using XY Scatter Chart.I am writing the below code but when executed , it gives weird results -blanks out the entire chart

    Below is the code.
    Please Login or Register  to view this content.
    Please help.
    Attached Files Attached Files

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

    Re: VBA to set Minimum and Maximum Values of X Axis

    You are setting the values of the wrong axis.

    Please Login or Register  to view this content.
    In a xy-scatter chart the horizontal (x-axis) is the xlCategory axis

  5. #5
    Registered User
    Join Date
    03-13-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: VBA to set Minimum and Maximum Values of X Axis

    Thank you so much , it worked..Appreciate your help

+ 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. linking maximum and minimum y axis values to a cell value
    By randor in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-15-2013, 08:12 PM
  2. Replies: 10
    Last Post: 10-07-2013, 11:41 AM
  3. Charts: Format Axis -> Axis Options -> Fixed minimum and maximum
    By johnmata in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-28-2013, 05:53 PM
  4. Replies: 1
    Last Post: 12-15-2012, 11:32 AM
  5. Replies: 1
    Last Post: 02-12-2010, 05:03 PM

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