Results 1 to 3 of 3

Thread: find nearest above number from array

  1. #1
    100 Club
    Join Date
    2011-08
    Location
    Vadodara, India
    Posts
    147
    Login to Give a bone
    0

    Default find nearest above number from array

    Hi!

    I need to find a nearest above number from array

    a = 9858 or may be 6236, 4655, 7213 1230 or any

    array = (10000, 9300 6300)

    answer = (10000 for 985 (7213 = 9300) etc... required.

    any help appropriated.

    Thanks,

    Avinash Patil

  2. #2
    Member
    Join Date
    2011-08
    Posts
    14
    Login to Give a bone
    0

    Default Re: find nearest above number from array

    You can try this function. The array must be in descending order

    Sub main()
    MsgBox nextup(929)
    End Sub
    Function nextup(x)
    For Each num In Array(1000, 930, 630)
    If x < num Then nextup = num
    Next num
    End Function

  3. #3
    100 Club
    Join Date
    2011-08
    Location
    Vadodara, India
    Posts
    147
    Login to Give a bone
    0

    Default Re: find nearest above number from array

    thanks friend

    this makes lots of help

Similar Threads

  1. Replies: 3
    Last Post: 2015-11-13, 08:06 AM
  2. Array BLOCK and increment number
    By madcadder in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2014-02-07, 05:16 PM
  3. Find the nearest Column to an XYZ point?
    By scowsert in forum Revit - API
    Replies: 3
    Last Post: 2009-11-25, 07:28 AM
  4. random number based array
    By crispin.schurr in forum Revit Architecture - Families
    Replies: 5
    Last Post: 2008-07-08, 12:49 AM
  5. Round up to the nearest even number
    By ReachAndre in forum AutoLISP
    Replies: 2
    Last Post: 2007-04-16, 02:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •