Skip, Now you're talking! Many thanks for your help!
It's that "On Error Resume Next" that does it.
And thanks to Cheerio for the generalisation of the method by creating user functions.
Cheers
Cherif
Skip, the issue remains unresolved! As I said, declaring dim n (or adding a format to n) makes no difference. Did you try it with a substring that's not in the search string?
For example:
N = Application.WorksheetFunction.Search("R", "SAMPLE").
rgds
Cherif
Thanks for that but the declaration is already there as
dim n integer.
Using
N = Application.WorksheetFunction.Search("S", "SAMPLE")
works because "S" exists within "SAMPLE". If you try "R" for example, then
N = Application.WorksheetFunction.Search("R", "SAMPLE") still gives an error!
Within an Excel spreadsheet I have a form whose code uses the worksheet SEARCH function. If the search string does not exist I get an error message.
For example:
N = Application.WorksheetFunction.Search("R", "SAMPLE")
This gives an error "Unable to get the serach property of the worksheet...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.