Aradaki farkı bulma

Katılım
16 Eylül 2011
Mesajlar
10
Excel Vers. ve Dili
TÜRKÇE
Selamlar ,

Ekli dosyada 2 ayrı sütün da 2011 yılı ile 2012 yılı arasındaki farkları bulmak (olan yada olmayan/değişen değişmeyen ) istiyorum.
Nasıl yapabilirim?

Yardımınız için şimdiden teşekürler.
 

Ekli dosyalar

N.Ziya Hiçdurmaz

Özel Üye
Katılım
28 Nisan 2007
Mesajlar
2,218
Excel Vers. ve Dili
Office 2013 TR / 32 Bit
yanıt

Kod:
Sub benzersizler()
Dim sat As Integer
Dim s As Integer
Range("d2:e" & Rows.Count).ClearContents
s = 2
    son = Cells(Rows.Count, "c").End(xlUp).Row
    For sat = 2 To Cells(Rows.Count, "a").End(xlUp).Row
    Set bul = Range("c2:c" & son).Find(Cells(sat, "a"), , xlValues, xlWhole)
        If bul Is Nothing Then
            Cells(s, "d") = Cells(sat, "a")
            s = s + 1
        End If
    Next
    '
s = 2
    son = Cells(Rows.Count, "c").End(xlUp).Row
    For sat = 2 To Cells(Rows.Count, "a").End(xlUp).Row
    Set bul = Range("c2:c" & son).Find(Cells(sat, "a"), , xlValues, xlWhole)
        If Not bul Is Nothing Then
            Cells(s, "e") = Cells(sat, "a")
            s = s + 1
        End If
    Next

End Sub
 

Ekli dosyalar

Katılım
16 Eylül 2011
Mesajlar
10
Excel Vers. ve Dili
TÜRKÇE
Cevap için teşekürler , sanırım işlemde bir hata var ,

8542.32.45.00.00 Bu her iki listede varken benzersizlere atmış ,
9008.20.00.00.00bunu iki defa yazmış ,

Saygılar.
Kod:
Sub benzersizler()
Dim sat As Integer
Dim s As Integer
Range("d2:e" & Rows.Count).ClearContents
s = 2
    son = Cells(Rows.Count, "c").End(xlUp).Row
    For sat = 2 To Cells(Rows.Count, "a").End(xlUp).Row
    Set bul = Range("c2:c" & son).Find(Cells(sat, "a"), , xlValues, xlWhole)
        If bul Is Nothing Then
            Cells(s, "d") = Cells(sat, "a")
            s = s + 1
        End If
    Next
    '
s = 2
    son = Cells(Rows.Count, "c").End(xlUp).Row
    For sat = 2 To Cells(Rows.Count, "a").End(xlUp).Row
    Set bul = Range("c2:c" & son).Find(Cells(sat, "a"), , xlValues, xlWhole)
        If Not bul Is Nothing Then
            Cells(s, "e") = Cells(sat, "a")
            s = s + 1
        End If
    Next

End Sub
 
Üst