Results 1 to 2 of 2

Thread: compare two coloum with other two coloum

  1. #1
    Neophyte aswathy0001's Avatar
    Join Date
    Nov 2016
    Location
    india
    Posts
    2
    Articles
    0
    Excel Version
    2010

    Post compare two coloum with other two coloum



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

    compare two coloum with other two coloum if both exactly same i want to delete first coloumn

    for example
    A1= Name B1= Age
    C1= Name D1= Age

    i need if A and B is exactly same in then C and D (end of row) then that should Delete
    how can i write a macro
    can any one? please

  2. #2
    Neophyte ges's Avatar
    Join Date
    Jul 2019
    Location
    Italy
    Posts
    3
    Articles
    0
    Excel Version
    2016
    Hi,
    try
    Code:
    Sub deleteRow()Dim lR As Long, i As Long
        lR = Cells(Rows.Count, 1).End(xlUp).Row
        For i = lR To 1 Step -1
            If Cells(i, 1) & Cells(i, 2) = Cells(i, 3) & Cells(i, 4) Then
                Cells(i, 1).EntireRow.Delete
            End If
        Next i
    End Sub

Posting Permissions

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