+ Reply to Thread
Results 1 to 4 of 4

Delete Rows with specific criteria

  1. #1
    Registered User
    Join Date
    04-22-2012
    Location
    TN
    MS-Off Ver
    Excel 2003
    Posts
    22

    Delete Rows with specific criteria

    I have a spreadsheet and I want to delete all rows in column H that contains the following, 370, 376, 382, 392. Of if it is easier, I want to only keep rows in column H that contain the following 471, 477, 483 and 493. My spreadsheet is updated daily so I don't have a definitive number of rows. How would something like that be coded with VBA? Thank you

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Delete Rows with specific criteria

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-22-2012
    Location
    TN
    MS-Off Ver
    Excel 2003
    Posts
    22
    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Please Login or Register  to view this content.
    Thank you so much for this information. I want to learn through this process so mad I ask you what does the code "end(3).row to 2 Select Case Cells (I," mean and do?

    Thank you

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Delete Rows with specific criteria

    End(3).row is a shorter version of End(xlUp).row - it chooses last cell with data, in this case Column H.

    Select Case Cells(i,"H").value is a statement which identifies the value of the cell in Column H in the i Loop
    Case is = defines which values to consider when using the i Loop

    Hope that helps.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How can I delete rows based on specific criteria using a macro?
    By akouleze in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2011, 02:49 AM
  2. Delete rows based on specific criteria
    By Archana in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2007, 05:00 AM
  3. [SOLVED] Delete rows if specific criteria not met.
    By SITCFanTN in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-04-2006, 07:25 PM
  4. [SOLVED] Delete rows that do not meet specific criteria
    By SITCFanTN in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2006, 11:36 AM
  5. [SOLVED] I want to delete certain rows based on specific criteria
    By Alaphas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2005, 07:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1