View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Further help on delete criteria found

I assume you mean clear their contents rather than delete. I will assume
#N/A is produced by a formula and you have no other error values in that
column

Sub ClearErrors()
Dim rng as Range, rng1 as Range, rng2 as range
On Error Resume Next
set rng = Columns(22).SpecialCells(xlformulas,xlErrors)
On Error goto 0
set rng1 = Range("V:AB")
if not rng is nothing then
set rng2 = Intersect(rng.entireRow,rng1)
rng2.clearContents
End if
End Sub

--
regards,
Tom Ogilvy



"Tempy" wrote in message
...
Hi,

Bob helped me with some code to find and delete criteria found but i
need further help.
I have 151 columns and 10 to 5000 rows.
In filter 22, column V, i must find all the cells with #N/A in and clear
all cells in columns V to AB.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***