Thread: Find Problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John John is offline
external usenet poster
 
Posts: 2,069
Default Find Problem

Hi,

Using Code to find a value, and if found, then delete the line.
Simple right?


Cells.Find(what:="2000103", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

If ActiveCell.Value = 2000103 Then
Selection.EntireRow.Delete

End If


But problem is, when the value 2000103 is not present, I get Run Time Error
91.

Any ideas on debugging?