Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find method Returns
How do i get the Find method to programmically return whether it found the
specified value or not? -- Trent Argante [DC.J(455)] |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find method Returns
Try something like
Dim FoundCell As Range Set FoundCell = Range(your_range).Find(what:="abc") If Not FoundCell Is Nothing Then Debug.Print "Found: " & FoundCell.Address Else Debug.Print "Not Found." End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Trent Argante" wrote in message ... How do i get the Find method to programmically return whether it found the specified value or not? -- Trent Argante [DC.J(455)] |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find method Returns
For the find you have specified the What. Depending what you are looking for
(text or number) you should probably specify, LookAt (xlWhole, xlPart), LookIn (xlformula, xlValues), MatchCase (true or false). Excel uses the last setting that was used for a Find, which may or may not be what you want. I have never had any luck determining the setting before doing the find (Chip if there is a way I would love to know what it is.) so you may need to modify these settings. -- HTH... Jim Thomlinson "Chip Pearson" wrote: Try something like Dim FoundCell As Range Set FoundCell = Range(your_range).Find(what:="abc") If Not FoundCell Is Nothing Then Debug.Print "Found: " & FoundCell.Address Else Debug.Print "Not Found." End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Trent Argante" wrote in message ... How do i get the Find method to programmically return whether it found the specified value or not? -- Trent Argante [DC.J(455)] |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find method Returns
Chip & Jim,
Thank you, both, for your help. The code is running quite well now. -- Trent Argante [DC.J(455)] "Jim Thomlinson" wrote: For the find you have specified the What. Depending what you are looking for (text or number) you should probably specify, LookAt (xlWhole, xlPart), LookIn (xlformula, xlValues), MatchCase (true or false). Excel uses the last setting that was used for a Find, which may or may not be what you want. I have never had any luck determining the setting before doing the find (Chip if there is a way I would love to know what it is.) so you may need to modify these settings. -- HTH... Jim Thomlinson "Chip Pearson" wrote: Try something like Dim FoundCell As Range Set FoundCell = Range(your_range).Find(what:="abc") If Not FoundCell Is Nothing Then Debug.Print "Found: " & FoundCell.Address Else Debug.Print "Not Found." End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Trent Argante" wrote in message ... How do i get the Find method to programmically return whether it found the specified value or not? -- Trent Argante [DC.J(455)] |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find function returns the #VALUE! error value | Excel Discussion (Misc queries) | |||
date find using find method | Excel Programming | |||
How to find returns in cells | Excel Worksheet Functions | |||
Using variables to make a date and using find method to find that. | Excel Programming | |||
Find Next in a selection, how to stop it when it returns to the fi | Excel Programming |