+ Reply to Thread
Results 1 to 6 of 6

Problem using Worksheet functions in VBA (FLOOR, SMALL & COUNTIF)

  1. #1
    Registered User
    Join Date
    05-12-2012
    Location
    Scottsbluff, Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    9

    Problem using Worksheet functions in VBA (FLOOR, SMALL & COUNTIF)

    Can anyone see what is wrong with the following formula? I am trying to set my minimum value of my chart axis to be the next multiple of 50 down from the smallest value in the ranges shown, but they contain zero values so it is attempting to overcome those with the SMALL/COUNTIF/LEN shenanigans


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    05-12-2012
    Location
    Scottsbluff, Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Problem using Worksheet functions in VBA (FLOOR, SMALL & COUNTIF)

    BTW the reason I am not just using MIN is because one of the ranges has a formula in it so it seems to throw it off

  3. #3
    Registered User
    Join Date
    05-12-2012
    Location
    Scottsbluff, Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Problem using Worksheet functions in VBA (FLOOR, SMALL & COUNTIF)

    BTW the reason I am not just using MIN is because one of the ranges has a formula in it so it seems to throw it off

    (Did not mean to post twice, and cannot find a way to delete it, my apologies)
    Last edited by martinbanks; 05-15-2012 at 06:38 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Problem using Worksheet functions in VBA (FLOOR, SMALL & COUNTIF)

    Maybe ...

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    05-12-2012
    Location
    Scottsbluff, Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Problem using Worksheet functions in VBA (FLOOR, SMALL & COUNTIF)

    That looks great. I have never heard of or used Evaluate before but if it works the way it looks like then it will be a great new weapon to my arsenal

    One question; will it work like this:

    Sheet1.ChartObjects("Chart 1").Chart.Axes(xlValue).MinimumScale = Evaluate("floor(min(if(B3:B45>0, B3:B45), if(E3:E45>0, E3:E45)), 50)")

  6. #6
    Registered User
    Join Date
    05-12-2012
    Location
    Scottsbluff, Nebraska
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Problem using Worksheet functions in VBA (FLOOR, SMALL & COUNTIF)

    YOU BEAUTY!!!! That works wonderfully Thank you very much. You just gave me a very flexible, crafty weapon. Much appreciated my friend

+ 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