Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie question: function call
I am using a function to do binary search of an array. I got the code
from a refence book. The function is, dhBinarySearch(varItems as Variant, varSought as Variant) As Long The return value is -1 if varSought not found or the position of varSought in the array. In my sub, I have the following code Call dhBinarySearch(varItems, varSought) If dhBinarySearch = -1 then does something here else does something else here end if When I tried to run it, an error box pops up that says Compile error: Argument not optional and highlights the word dhBinarySearch in the If statement Can anyone help? Thanks Warren |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie question: function call
If dhBinarySearch(varItems, varSought) = -1 then does something here else does something else here end if would be the way you would use Mr Getz's function. -- Regards, Tom Ogilvy "wachen" wrote in message om... I am using a function to do binary search of an array. I got the code from a refence book. The function is, dhBinarySearch(varItems as Variant, varSought as Variant) As Long The return value is -1 if varSought not found or the position of varSought in the array. In my sub, I have the following code Call dhBinarySearch(varItems, varSought) If dhBinarySearch = -1 then does something here else does something else here end if When I tried to run it, an error box pops up that says Compile error: Argument not optional and highlights the word dhBinarySearch in the If statement Can anyone help? Thanks Warren |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Newbie Question | New Users to Excel | |||
Real Newbie newbie question | New Users to Excel | |||
If Then Question from Newbie. . . | Excel Discussion (Misc queries) | |||
Newbie Question, NOW() function | Excel Worksheet Functions | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) |