View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Looping Find Next

Hi All

I have the following code which finds the #DIV/0! error
and removes this value from the sheet that I'm working
on, the code is below but I was wondering how I could
loop this rather than run the same macro continuously
until I get an error?

The code I've got is as follows:

Selection.Find(What:="#DIV/0!", After:=ActiveCell,
LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
ActiveCell.Select
Selection.ClearContents
Cells.FindNext(After:=ActiveCell).Activate
Selection.ClearContents