PC Review


Reply
Thread Tools Rate Thread

Delete all Rows containing #N/A once a VLookup has been performed

 
 
Shirley Munro
Guest
Posts: n/a
 
      5th Sep 2005

Hi

I am recording a Macro which uses a VLookup to fill in values in column
A from another file. Where a match is not found it displays #N/A. I
can use AutoFilter to filter out all the #N/A's and then delete these
rows. The problem is that the orginal file is downloaded on a regular
basis and the number of rows varies and therefore the number of #N/A's.
Is there macro code which will automatically delete all rows containing
#N/A's.

Thanks

Shirley


--
Shirley Munro
------------------------------------------------------------------------
Shirley Munro's Profile: http://www.excelforum.com/member.php...nfo&userid=836
View this thread: http://www.excelforum.com/showthread...hreadid=401909

 
Reply With Quote
 
 
 
 
gearoi
Guest
Posts: n/a
 
      5th Sep 2005

Use a loop -

dim down as long

down = 0
do while range(top of your range).offset(down,0).value <>""

'add the delete the particular row code here
down = down + 1
loop

that way you don't need to faff about with autofilters and if you tur
off calculation in the macro too this should be pretty quick

--
gearo
-----------------------------------------------------------------------
gearoi's Profile: http://www.excelforum.com/member.php...fo&userid=2657
View this thread: http://www.excelforum.com/showthread.php?threadid=40190

 
Reply With Quote
 
Debra Dalgleish
Guest
Posts: n/a
 
      5th Sep 2005
If there are no other types of errors in column A, you can record a
macro as you do the following steps:

Select column A
Choose Edit>Go To
Click the Special button
Select Formulas, and clear all the check marks except Errors
Click OK
Choose Edit>Delete
Select Entire Row, click OK

Shirley Munro wrote:
> Hi
>
> I am recording a Macro which uses a VLookup to fill in values in column
> A from another file. Where a match is not found it displays #N/A. I
> can use AutoFilter to filter out all the #N/A's and then delete these
> rows. The problem is that the orginal file is downloaded on a regular
> basis and the number of rows varies and therefore the number of #N/A's.
> Is there macro code which will automatically delete all rows containing
> #N/A's.
>
> Thanks
>
> Shirley
>
>



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofil on variable rows, delete extract and show remaining rows 1plane Microsoft Excel Programming 3 17th Nov 2009 10:49 AM
using a vlookup to enter text into rows beneath the vlookup cell Roger on Excel Microsoft Excel Programming 1 29th Nov 2007 12:09 PM
Copy pasting Rows, but need to Delete any Shapes/Pictures that are within copied rows Corey Microsoft Excel Programming 2 1st Aug 2007 02:02 AM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Microsoft Excel Worksheet Functions 0 13th Dec 2006 01:25 AM
Delete rows with numeric values, leave rows with text =?Utf-8?B?R1NwbGluZQ==?= Microsoft Excel Programming 5 11th Oct 2005 12:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:55 PM.