View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Display message if "find" command comes up blank ??

One way:

Dim rFound As Range
Set rFound = Columns(1).Find("mytext")
If rFound Is Nothing Then
MsgBox "Didn't find 'mytext'"
Else
'your macro stuff here
End if


In article . com,
wrote:

At one point within a macro I'm searching a column for a specific text
using the "Find" command. If the search comes up empty I want to
display a message to the user and end the macro. How do I do this?