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
|
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
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
thanks friend
this makes lots of help