+ Reply to Thread
Results 1 to 2 of 2

Delete data in cells that don't meet criteria

  1. #1
    SITCFanTN
    Guest

    Delete data in cells that don't meet criteria

    I'm not sure how I would code deleting any data in the cells in Column "Type"
    if it is not "HO". The report I download sometimes puts odd letters in cells
    in this column and I just want to clear it out rather than scan this very
    long report and delete manually. I will put the code in an existing macro.
    Thank you

  2. #2
    Paul B
    Guest

    Re: Delete data in cells that don't meet criteria

    sitcfantn, here is one way

    Sub Delete_HO()

    Dim iRow As Long
    Dim SpecValue As String

    SpecValue = "HO"

    If SpecValue = "" Then Exit Sub

    For iRow = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
    If Cells(iRow, 1) = SpecValue Then Rows(iRow).Delete
    Next iRow

    End Sub


    --
    Paul B
    Always backup your data before trying something new
    Please post any response to the newsgroups so others can benefit from it
    Feedback on answers is always appreciated!
    Using Excel 2002 & 2003

    "SITCFanTN" <SITCFanTN@discussions.microsoft.com> wrote in message
    news:35ADF4F6-B941-4222-BFA9-6E717B6239EE@microsoft.com...
    > I'm not sure how I would code deleting any data in the cells in Column

    "Type"
    > if it is not "HO". The report I download sometimes puts odd letters in

    cells
    > in this column and I just want to clear it out rather than scan this very
    > long report and delete manually. I will put the code in an existing

    macro.
    > Thank you




+ 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