Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display "Does not exist" upon search no results
Hi,
I'd like my search looping in VBA to display a message that says that the identification written does not exist in the list. It must be something like "On Error GoTo MsgBox" To I imagine. But I don't know hw to write it. Thx JJD -- Message posted via http://www.officekb.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display "Does not exist" upon search no results
On error go to ErrorHandler
ErrorHandler: Msgbox "error message" -- _______________________ Naz, London "Jean-Jerome Doucet via OfficeKB.com" wrote: Hi, I'd like my search looping in VBA to display a message that says that the identification written does not exist in the list. It must be something like "On Error GoTo MsgBox" To I imagine. But I don't know hw to write it. Thx JJD -- Message posted via http://www.officekb.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display "Does not exist" upon search no results
Give this a try...
Public Sub SearchList() Dim wks As Worksheet Dim rngCurrent As Range Dim rngToSearch As Range Set wks = Sheets("Sheet1") Set rngToSearch = wks.Range("A1", "A100") Set rngCurrent = rngToSearch.Find("This") If rngCurrent Is Nothing Then MsgBox "Not Found" Else MsgBox rngCurrent.Address End If End Sub -- HTH... Jim Thomlinson "Jean-Jerome Doucet via OfficeKB.com" wrote: Hi, I'd like my search looping in VBA to display a message that says that the identification written does not exist in the list. It must be something like "On Error GoTo MsgBox" To I imagine. But I don't know hw to write it. Thx JJD -- Message posted via http://www.officekb.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display "Does not exist" upon search no results
Thanks Jim Thomlinson and Naz! It was the little spark of light needed to
achieve my goal. Have a good day! JJD -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
search for text "beginning with" "containing" wildcards | Excel Worksheet Functions | |||
=IF(ISNUMBER(SEARCH("ELB",B2)),"Pipe") add more like "ELB" "FLG" | Excel Worksheet Functions | |||
=IF(ISERROR(SEARCH("insurance",A125,1)),"","*") | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
How do I change the column heading in Excel to display "A" "B" "C | New Users to Excel |