Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find
Hello,
I currently use the standard vba code to find specific cells (data, words) within a spreadsheet. Selection.Find(What:="NEW1", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate My problem is when the information is not in the spreadsheet I get an error. How could I rephrase my code not give me an error if the information is not in the sheet (in this case the wording "NEW1" is not in the sheet.) Thank You, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find
Hi,
Try: Dim r As Range Set r = Selection.Find( . . . .) if not r is nothing then do your stuff . . . End If HTH Peter Beach wrote in message ... Hello, I currently use the standard vba code to find specific cells (data, words) within a spreadsheet. Selection.Find(What:="NEW1", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate My problem is when the information is not in the spreadsheet I get an error. How could I rephrase my code not give me an error if the information is not in the sheet (in this case the wording "NEW1" is not in the sheet.) Thank You, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
where to put results of find operation in find and replace functio | Excel Worksheet Functions | |||
Despite data existing in Excel 2002 spreadsheet Find doesn't find | Excel Discussion (Misc queries) | |||
'find' somtimes can't find numbers. I folowd the 'help' instructi. | Excel Worksheet Functions | |||
backwards find function to find character in a string of text | Excel Programming |