Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to implement a simple search algorithm via vba.
My Problem is that i cannot seem to handle a #value error within vba The UDF is called "FindBP" Sometimes the Variable vIndex causes an #N/A Error, resulting in an #vlaue error of the function. I want to replace the vIndex calculation, every time it gives an error. My Implementation doesn't seem to work: ...... vIndex = WorksheetFunction.Match(vBP, rg, -1) vCount = WorksheetFunction.Index(rg, vIndex) If IsError(vCount) Then vIndex = WorksheetFunction.Match(vBP, rg, 1) FindBP = WorksheetFunction.Index(rg, vIndex) Else FindBP = WorksheetFunction.Index(rg, vIndex) End If ..... Any help is highly appreciated. Thy in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error dialog box meaning and how to find error | Excel Worksheet Functions | |||
Find error!!!! Is there any other way to do this? | Excel Programming | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
change error message when no more for "find" in macro to find | Excel Programming | |||
Can someone find this error? | Excel Programming |