LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Delete rows that do not match criteria

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" wrote in message
...
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?


 
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 do I Remove Rows that match a criteria Mahesh Excel Discussion (Misc queries) 3 April 30th 07 10:58 PM
VB Delete rows that do not match criteria rlee1999 Excel Programming 2 November 1st 06 11:19 PM
Delete Rows in Worksheet2 that Match Criteria in Worksheet1!A1:A20 SteveC Excel Programming 3 June 22nd 06 02:56 AM
How to get number of rows which match criteria kiranmani Excel Worksheet Functions 6 July 11th 05 03:41 PM
Get rows which match selection criteria Fred Smith Excel Programming 1 February 21st 04 03:52 AM


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

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

About Us

"It's about Microsoft Excel"