Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for all the input.
I think it is better starting from the bottom, I did notice it was deleting all the rows. "Paulw2k" wrote in message ... Hi Doug, If you are going to use this method for row deletion then work up from the bottom. Everything under a deleted row moves up one, so those rows should be ones the code has already tested. So, ascertain the last block row number with a bit of code. y=Range("A" & Rows.Count).End(xlUp).Row 'Assumes nothing beneath the block of data you are dealing with. Do while y<4 If Range("F" & y).Value = "957-TYPE" Or _ Range("F" & y).Value = "149-DUPLICATE" Then Range("F" & y).EntireRow.Delete End If y = y - 1 Loop "Doug Van" wrote in message ... This is similar to the "Is this Possible?" post. I want to delete a record that meets a certain condition. This works with the first condition, but anything after the "or" won't delete. y = 5 Do While Range("A" & y) < "" If Range("F" & y).Value = "957-TYPE" Or _ Range("F" & y).Value = "149-DUPLICATE" Then Range("F" & y).EntireRow.Delete End If y = y + 1 Loop |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I delete a macro when the Delete button is not active? | Excel Worksheet Functions | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions |