Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default 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
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
Deleting Rows w/ Specific Criteria MCSHMCH Excel Discussion (Misc queries) 2 September 28th 07 01:05 PM
Deleting rows with specific values whatzzup Excel Discussion (Misc queries) 1 July 6th 06 10:35 AM
Deleting row with specific value Jed Excel Discussion (Misc queries) 2 January 12th 06 01:59 PM
Deleting specific records [email protected] Excel Discussion (Misc queries) 6 June 22nd 05 11:35 PM
Deleting Specific Rows ScaffoldingDepot Excel Discussion (Misc queries) 2 May 4th 05 04:08 PM


All times are GMT +1. The time now is 07:48 AM.

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

About Us

"It's about Microsoft Excel"