+ Reply to Thread
Results 1 to 3 of 3

Deleting rows with a specific value in the first column

Hybrid View

  1. #1
    Registered User
    Join Date
    10-05-2007
    Posts
    11

    Deleting rows with a specific value in the first column

    Hey,

    I need to delete rows that have 0 (or another specific value) as value in the first column (see selection in example).

    Tried several vba codes, but can't get it to work. Can anyone help?
    Attached Images Attached Images
    Last edited by nevrborn; 10-05-2007 at 06:14 AM.

  2. #2
    Forum Contributor
    Join Date
    03-24-2004
    Location
    Edam Netherlands
    Posts
    181
    This should work

    
    Option Explicit
    
    Sub remove_Row()
    
        Dim i As Long
        
        For i = Range("A1").End(xlDown).Row To 1 Step -1
        
            If Range("A" & i).Value = 0 Then Rows(i).Delete
        
        Next i
    
    End Sub

  3. #3
    Registered User
    Join Date
    10-05-2007
    Posts
    11
    thanks, that works great!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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