+ Reply to Thread
Results 1 to 5 of 5

How to change min/max values in Excel chart?

  1. #1
    Registered User
    Join Date
    01-07-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    25

    How to change min/max values in Excel chart?

    Hi - I want to set the min and max values of the X axis on an Excel chart based upon data entered into two cells. This is the code I wrote:

    Please Login or Register  to view this content.
    The problem is that the code seems to do... nothing. I have named the two charts RLCMagnitude and RLCPhase. The lower and upper bounds are in E4 and F4. Any ideas?

    I should mention that the only reason I want to do this is that Excel isn't automatically choosing sensible lower bounds for my plot. My x scale is logarithmic and it always has the minimum bound set to 1, no matter what the smallest value being displayed is. It does seem to intelligently set the upper bound. Strange.

    One last question - is there a better way to do the "If Target.Address = "$E$4" Or Target.Address = "$F$4" Then" line for if you want to check if the selected cell is included in a large range of cells (ie anything between rows columns E and Z and rows 4 and 6) ie something like "if Target.address exists in [E4-Z6] then". Hopefully that made sense.

    Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,243

    Re: How to change min/max values in Excel chart?

    Please Login or Register  to view this content.

    Or

    Please Login or Register  to view this content.

    I prefer the first approach.


    Put a Stop as the first line of the event code. Then step through the code to see what it is doing.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-07-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How to change min/max values in Excel chart?

    Thanks TMS! Your solution worked well for checking the range.

    As for why my code above wasn't working... well, it is now, even without changing anything. I have no idea why it wasn't working last night. Maybe it was and I was just too tired to notice. No idea...
    Last edited by jeffreybrown; 09-13-2012 at 02:30 PM. Reason: Removed unnecessary quote

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: How to change min/max values in Excel chart?

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    HTH
    Regards, Jeff

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,243

    Re: How to change min/max values in Excel chart?

    It may just have been that event handling had been switched off somewhere along the way ... and you have reset it.

    But, whatever, it's doing what you want now and you have a mechanism for diagnosing faults in the future.

    Thanks for the rep.

+ 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