PC Review


Reply
Thread Tools Rate Thread

Delete rows that do not match criteria

 
 
=?Utf-8?B?cmxlZTE5OTk=?=
Guest
Posts: n/a
 
      2nd Nov 2006
This worked Great on the Sheet 1. When it comes to Sheet 2 and Sheet 3, I
believe it is looking for a number value, however because rows were deleted
on Sheet 1, I have errors on Sheet 2 and Sheet 3. How do I get it to delete
rows with errors also?

~Robert

"Bob Phillips" wrote:

> For i = Cells(Rows.Count,"D").End(xlUp).Row To 2 Step -1
> If Cells(i,"D").Value <> Range("D2").Value Then
> Rows(i).Delete
> End If
> Next i
>
> --
>
> HTH
>
> Bob Phillips
>
> (replace xxxx in the email address with gmail if mailing direct)
>
> "rlee1999" <(E-Mail Removed)> wrote in message
> news:6B87C239-FC9F-4BEC-9E30-(E-Mail Removed)...
> > I need to paste data into a template sheet. The data is never more than

> 2000
> > rows. If the data being pasted is only 1000 rows I need check the entire

> 2000
> > rows in Col D against the value in D2. If D? does not match D2 I need that
> > row to be deleted... Any suggestions?


 
Reply With Quote
 
 
 
 
Susan
Guest
Posts: n/a
 
      3rd Nov 2006
how 'bout if you started backwards & deleted from worksheet 3 to
worksheet1? then the value you needed would be deleted last.
just an idea.........
susan


rlee1999 wrote:
> This worked Great on the Sheet 1. When it comes to Sheet 2 and Sheet 3, I
> believe it is looking for a number value, however because rows were deleted
> on Sheet 1, I have errors on Sheet 2 and Sheet 3. How do I get it to delete
> rows with errors also?
>
> ~Robert
>
> "Bob Phillips" wrote:
>
> > For i = Cells(Rows.Count,"D").End(xlUp).Row To 2 Step -1
> > If Cells(i,"D").Value <> Range("D2").Value Then
> > Rows(i).Delete
> > End If
> > Next i
> >
> > --
> >
> > HTH
> >
> > Bob Phillips
> >
> > (replace xxxx in the email address with gmail if mailing direct)
> >
> > "rlee1999" <(E-Mail Removed)> wrote in message
> > news:6B87C239-FC9F-4BEC-9E30-(E-Mail Removed)...
> > > I need to paste data into a template sheet. The data is never more than

> > 2000
> > > rows. If the data being pasted is only 1000 rows I need check the entire

> > 2000
> > > rows in Col D against the value in D2. If D? does not match D2 I need that
> > > row to be deleted... Any suggestions?


 
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
Delete rows where 1st 3 characters in string don't match criteria Peruanos72 Microsoft Excel Programming 2 14th Apr 2009 07:27 PM
How do I Remove Rows that match a criteria =?Utf-8?B?TWFoZXNo?= Microsoft Excel Misc 3 30th Apr 2007 10:58 PM
VB Delete rows that do not match criteria =?Utf-8?B?cmxlZTE5OTk=?= Microsoft Excel Programming 2 1st Nov 2006 11:19 PM
Delete Rows in Worksheet2 that Match Criteria in Worksheet1!A1:A20 =?Utf-8?B?U3RldmVD?= Microsoft Excel Programming 3 22nd Jun 2006 02:56 AM
How to get number of rows which match criteria =?Utf-8?B?a2lyYW5tYW5p?= Microsoft Excel Worksheet Functions 6 11th Jul 2005 03:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:11 PM.