Results 1 to 3 of 3

Thread: 1 FILTERING help PLSsss

  1. #1

    1 FILTERING help PLSsss



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I want a comparison to be done between the text values in column A & B. Find the matches and deleted the matching cell values from column A. Column B's data should not get deleted.

    How do I do it?

  2. #2
    Off the top

    Code:
    With Activesheet
    
        lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
        For i = lastrow to 1 Step -1
    
            If Not IsError(Application.Match(.Cells(i, "A").Value, .Columns(2),0)) Then
    
                .Cells(i, "A").Delete Shift:=xlUp
            End If
        Next i
    End With

  3. #3
    Quote Originally Posted by kjijujoseph View Post
    I want a comparison to be done between the text values in column A & B. Find the matches and deleted the matching cell values from column A. Column B's data should not get deleted.

    How do I do it?

    Code:
    Sub deleteA()
    Dim endRow As String
    Sheets("Sheet1").Select
    endRow = Range("A65536").End(xlUp).Row
    Range("A1", "A" & endRow).Select
    For Each cell In Selection
    cell.Select
    i = ActiveCell.Row
    If Range("A" & i) = Range("B" & i) Then ActiveCell.Clear
    Next
    End Sub
    Here is an alternative that I think will work, it doesn't delete the cell in column A, just clears the text from it.

    HTH

    Aidan

Posting Permissions

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