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: 137
Default Select and Delete

Following code was adopted from thread and modified to select rows with €œY€
in column I. The problem is not all rows with €œY€ are deleted when range of
rows has found €œY€ (say row 10 to 16 all has Y), it is fine if single row is
found with €œY€.
Sheets("Data").Select
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
Range("I1").Formula = "=if(and(RC[-8]=DataInput!R1C1,RC[-4]=""Spot
Deal""),""Y"",""N"")"
Range("I1").Copy
Range("I1:I" & lastrow).Select
ActiveSheet.Paste
lastrow = Cells(Rows.Count, "I").End(xlUp).Row
Set myrange = Range("I2:I" & lastrow)
For Each Count In myrange
If Count.Value = "Y" Then
Count.EntireRow.Delete
End If
Next

 
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
Select and Delete Seeker Excel Programming 4 November 10th 09 07:25 AM
Select/Delete Sheets Mark Excel Programming 5 September 6th 09 12:17 AM
How to delete a 'Select Box' Bodin Excel Discussion (Misc queries) 1 April 28th 09 01:53 AM
How to select a row to delete Jeff Armstrong Excel Programming 2 November 12th 03 03:38 PM
Conditional Row Select and Delete jagstirling[_5_] Excel Programming 3 September 30th 03 08:46 AM


All times are GMT +1. The time now is 11:28 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"