Results 1 to 13 of 13

Excel macro - duplication in two lists

Threaded View

  1. #1
    Registered User
    Join Date
    08-29-2012
    Location
    Prague
    MS-Off Ver
    Excel 2003
    Posts
    8

    Excel macro - duplication in two lists

    Hey guys,

    I am absolutely new to excel programming, so I would appreciate a little help with my program. I have two lists with datas, both has a column with emails (simply text). I need need to compare those two columns, and if there is a duplicate email in the second list (List2), delete the whole row with the email. To sum it up, each time I need to compare one email from the List1 to plenty of emails from the List2 (that is why I chose 2 for cycles).

    Here is my work, but it does not work at all (there is probably a syntax error in the IF statement).

    Sub nahrada()
    
        For I = 0 To Rows.Count
          For J = 1 To Worksheets("List2").Rows.Count 
            IF (Range(Cells(I,6)).Text = Worksheets("List2").Range(Cells(J,3)).Text) Then
              Worksheets("List2").Rows(J).Delete
            End If    
          Next J
        Next I
    End Sub
    Thanks a lot for your help, I really appreciate it
    Last edited by vladozah; 09-01-2012 at 08:00 AM.

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