can't find cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

New to all this, bit confusing. I'm trying to find find cells and once found move them, there is no problem finding a cell by matching the text but it falls apart when the text doesn't exist in a cell. I need a simple 'if..then MsgBox' thing but can't figure out what it is, any chance anyone else has an idea?
 
One way:

Dim rFound As Range
Set rFound = Cells.Find( _
What:="the text", _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)
If Not rFound Is Nothing Then
'Move cell
Else
MsgBox """the text"" was not found"
End If
 
cheers, looks good, but wont work cos now it requires an object with the find cells, am I missing something obvious?
 
Ha! You were right, it took me a while to figure it out but I got there in
the end, thank you very much.
 
Back
Top