+ Reply to Thread
Results 1 to 2 of 2

Automatic Deleting of Rows

  1. #1
    Registered User
    Join Date
    04-02-2005
    Posts
    1

    Automatic Deleting of Rows

    Good Day Dear Experts,

    I wish to accomplish the followings automatically:
    1. search for all columns containing a given nummeric value (e.g 0)
    2. Deleting all ROWS with having that value,
    3. and saving the function as a macro

    Nice to have:
    Exiting Excel invokes the funktion automatically!

    Much obliged!
    Steve

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Steve

    Try this on a backup copy of your data

    It assumes Data is in column A

    Search is case sensitive eg a is not the same as A


    Sub DelRecords()
    Dim lRow As Long
    Dim sTxt As String

    sTxt$ = InputBox("Remove Rows With?")

    For lRow = Cells(Rows.Count, "a").End(xlUp).Row _
    To 1 Step -1
    If Cells(lRow, "a") = sTxt Then
    Rows(lRow).Delete
    End If
    Next lRow
    End Sub

+ 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