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?
|