+ Reply to Thread
Results 1 to 2 of 2

Deleting rows by criteria

Hybrid View

robertjtucker Deleting rows by criteria 04-28-2005, 03:49 PM
Leith Ross Hello Robert, Here is a... 04-28-2005, 07:38 PM
  1. #1
    Registered User
    Join Date
    04-04-2005
    Location
    Bahama, NC
    Posts
    59

    Deleting rows by criteria

    I just can't quite get the sub can one one give me a hand?
    I want to delete all rows that have a 0 in column E

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Robert,

    Here is a Sub to delete all Rows with 0 in column E.

    Private Sub DeleteRowIfZero()

    Dim R As Long

    R = 1

    Do
    With Cells(R, "E")
    If IsEmpty(.Value) Then Exit Do
    If IsNumeric(.Value) Then
    If .Value = 0 Then
    .Delete (xlShiftUp)
    R = R - 1
    End If
    End If
    R = R + 1
    End With
    Loop

    End Sub


    Sincerely,
    Leith Ross

+ 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