My program takes a name from sheet3 goes to sheet1 to Find the name.
If it cannot find name, how do you do an If/End to Exit Do while or
find out if name has been founf? I have "On Error Resume Next" in
program.
Thanks again for all your help
Gordon
Don Guillett - 16 Jul 2007 20:08 GMT
As ALWAYS, post your code for comments & suggestions.

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
> My program takes a name from sheet3 goes to sheet1 to Find the name.
> If it cannot find name, how do you do an If/End to Exit Do while or
[quoted text clipped - 3 lines]
> Thanks again for all your help
> Gordon
Harlan Grove - 16 Jul 2007 20:31 GMT
"Gordon" <gwelch1938@yahoo.com> wrote...
>My program takes a name from sheet3 goes to sheet1 to Find the name.
>If it cannot find name, how do you do an If/End to Exit Do while or
>find out if name has been founf? I have "On Error Resume Next" in
>program.
Somewhat ambiguous. If you search for the value of Sheet3!X99 in the used
range in Sheet1, maybe adapt the following.
Sub foo()
Dim fc As Range, v As Variant
On Error Resume Next
v = Worksheets("Sheet3").Range("X99").Value
Set fc = Worksheets("Sheet1").UsedRange.Find(What:=v, LookIn:=xlValues)
MsgBox Title:="Finding '" & CStr(v) & "'", _
Prompt:=IIf(fc Is Nothing, "not found", fc.Address(0, 0))
End Sub
Bob Umlas - 16 Jul 2007 20:32 GMT
On Error Resume Next
Set Found = Nothing
Set Found = Cells.Find(whateveryouarefinding)
If Not Found Is Nothing then
'successful
Else
'unsuccessful
End If
Bob Umlas
Excel MVP
> My program takes a name from sheet3 goes to sheet1 to Find the name.
> If it cannot find name, how do you do an If/End to Exit Do while or
[quoted text clipped - 3 lines]
> Thanks again for all your help
> Gordon