Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
that would be one of the slower ways to do it:
Function searchStr(searchedStr, otherStr) On Error GoTo errorHandler indice = Instr(1,searchedStr, otherStr,vbTextCompare) searchStr = indice Exit Function errorHandler: On Error GoTo 0 searchStr = -1 End Function if you want it to be case sensitive like FIND ("A" < "a"), then change vbTextCompare to vbBinaryCompare or just call instr directly instead of reinventing the wheel. -- Regards, Tom Ogilvy "itarnak" wrote in message ... That works great Function searchStr(searchedStr, otherStr) On Error GoTo errorHandler indice = Application.WorksheetFunction.Find(searchedStr, otherStr) searchStr = indice Exit Function errorHandler: On Error GoTo 0 searchStr = -1 End Function -- itarnak ------------------------------------------------------------------------ itarnak's Profile: http://www.excelforum.com/member.php...o&userid=27865 View this thread: http://www.excelforum.com/showthread...hreadid=478738 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find specific info using search string using VBA | Excel Discussion (Misc queries) | |||
Search/Match/Find ANY part of string to ANY part of Cell Value | Excel Worksheet Functions | |||
FIND / SEARCH text compare cell to string in 3rd cell | Excel Discussion (Misc queries) | |||
to search for a string and affect data if it finds the string? | Excel Worksheet Functions | |||
VBA function : How to search a string in another string? | Excel Programming |