C
Claude
I am trying to find to create a function that will perform
a search operation on a given worksheet range. I just
can't get this to work:
Function testfindfunction(valuetofind, rangetosearch)
testfindfunction = rangetosearch.Find(What:=valuetofind,
LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
Matchcase:=False).Address
MsgBox (testfindfunction & " function")
End Function
The function works fine when called from a macro (see
below), but not when used in a worksheet. Any ideas on
what's wrong? I'm using excel97.
Sub macro1()
Dim rangetosearch As range
Set rangetosearch = Selection
MsgBox (testfindfunction(522602, Selection) & "
functioncalled")
End Sub
a search operation on a given worksheet range. I just
can't get this to work:
Function testfindfunction(valuetofind, rangetosearch)
testfindfunction = rangetosearch.Find(What:=valuetofind,
LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
Matchcase:=False).Address
MsgBox (testfindfunction & " function")
End Function
The function works fine when called from a macro (see
below), but not when used in a worksheet. Any ideas on
what's wrong? I'm using excel97.
Sub macro1()
Dim rangetosearch As range
Set rangetosearch = Selection
MsgBox (testfindfunction(522602, Selection) & "
functioncalled")
End Sub