Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Find (but not find)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gordon - 16 Jul 2007 19:54 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.