Find Method within a called procedure
Try this:
HTH
--
AP
'----------------------------------------
Sub a__TEST()
Dim Chars As String, lRow As Long, lCol As Long
Chars = "zzzzend"
Call zString_Find(Chars, lRow, lCol)
MsgBox "Found row,col " & lRow & ", " & lCol, , "Find this: " & Chars
End Sub
Sub zString_Find( _
IFindTheseChars As String, _
ByRef lRow As Long, _
ByRef lCol As Long)
' I var names are input, O vars are output
Set foundCell = Cells.Find( _
What:=IFindTheseChars, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If foundCell Is Nothing Then
MsgBox "String not found"
lRow = 0
lCol = 0
Else
lRow = foundCell.Row
lCol = foundCell.Column
End If
End Sub
'----------------------------------------------------------
|