Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting rows with specific value from row 1 to 200
Hello, I want to delete rows with specific values in column c and d. This criteria must be done from row 1 to row 200. Regards, Niek ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting rows with specific value from row 1 to 200
DIM keyvalue as double
DIM rw as long keyvalue = 123.45 FOR rw = 200 TO 1 step -1 IF cells(rw,"C") = keyvalue _ OR _ cells(rw,"d") = keyvalue Then Rows(rw).Delete END IF NEXT Note that you need to move 'up' the sheet, hence the reverse for/next loop. If you did a normal for next, deleteing row 'n' would move row n+1 to row n, then the 'next' statment would ponit to the new row n+1, so the original n+1 row woul dbe 'skipped' over. Difficult to explain. but try it and see. Patrick Molloy Microsoft Excel MVP -----Original Message----- Hello, I want to delete rows with specific values in column c and d. This criteria must be done from row 1 to row 200. Regards, Niek ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting Rows w/ Specific Criteria | Excel Discussion (Misc queries) | |||
Deleting rows with specific values | Excel Discussion (Misc queries) | |||
Deleting row with specific value | Excel Discussion (Misc queries) | |||
Deleting specific records | Excel Discussion (Misc queries) | |||
Deleting Specific Rows | Excel Discussion (Misc queries) |