Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Further help on delete criteria found

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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
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 ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Further help on delete criteria found

Hi Thom,

sorry i do not think i am explaining myself clearly; Column V has the
error #N/A in, column W has a number, column X has #N/A and Y has a date
in. If V has the error #N/A then i must clear V, W, X and Y.

Hopefully that is clearer

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Further help on delete criteria found

Maybe you should try it. If works base on the assumptions I stated. Also,
you said you wanted to clear V to AB.

If you actually want to delete those rows, then post back.

--
Regards,
Tom Ogilvy


"Tempy" wrote in message
...
Hi Thom,

sorry i do not think i am explaining myself clearly; Column V has the
error #N/A in, column W has a number, column X has #N/A and Y has a date
in. If V has the error #N/A then i must clear V, W, X and Y.

Hopefully that is clearer

Tempy

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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Further help on delete criteria found

Hi Thom,

I tried your code without success, can i try & explain the problem
again.

I have to filter column 22 (V) for #N/A, which was an error code, but
the formular is removed and just the value saved. I then need to clear
all the cells from V:AB.

The columns have different values in as below

v W X Y Z AA AB
#N/A 11 #N/A 21-Jan-02 02 N or J N or J

Tempy

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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Further help on delete criteria found

Post back with a number of sample lines, before and what you want them to
look like after. We are having trouble understanding what you want.

--
HTH

Bob Phillips

"Tempy" wrote in message
...
Hi Thom,

I tried your code without success, can i try & explain the problem
again.

I have to filter column 22 (V) for #N/A, which was an error code, but
the formular is removed and just the value saved. I then need to clear
all the cells from V:AB.

The columns have different values in as below

v W X Y Z AA AB
#N/A 11 #N/A 21-Jan-02 02 N or J N or J

Tempy

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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Further help on delete criteria found

Hi all,
I apologise for the delay, time difference, below is an example; I need
to sort by #N/A which was a formula, but copyied and then pasted as
special-values only. I then need to clear the cells v to AB ONLY as all
the other cells in the same row have data that i require

V W X Y Z AA AB

2163254 11 01 18-Apr-05 J N
#N/A 11 #N/A 21-Jan-04
2078426 11 01 18-Mar-05 J J
2078427 11 01 10-Jan-05 J J
2077697 11 01 03-Mar-05 J J
2028870 11 01 23-Mar-05 J J
1933445 11 01 14-Dec-04 J J

Hopefully this will help

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete a row if strong NOT found.... JayKay100 Excel Discussion (Misc queries) 9 November 23rd 08 06:20 AM
Return all values found for criteria duketter Excel Discussion (Misc queries) 2 May 23rd 07 08:36 PM
How to delete values of a cell if it is found in another coloumn karty Excel Worksheet Functions 3 October 22nd 05 04:29 PM
specialcells method errors when criteria not found ms Excel Programming 8 April 22nd 04 09:53 PM
Go to record found by Criteria in Data Form Paul Simon[_3_] Excel Programming 0 December 18th 03 03:31 PM


All times are GMT +1. The time now is 11:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"