- Katılım
- 12 Mayıs 2016
- Mesajlar
- 386
- Excel Vers. ve Dili
- Ofis 2019- 32 Bit - Türkçe
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub karsilastir()
Dim sht1, sht2 As Worksheet
Set sht1 = Sheets("Sayfa1"): Set sht2 = Sheets("Sayfa2")
Dim str1, str2 As Long
str1 = sht1.Cells(Rows.Count, 4).End(3).Row
str2 = sht2.Cells(Rows.Count, 2).End(3).Row
Dim c, rng1, rng2 As Range
Set rng1 = sht1.Range("d4:d" & str1): Set rng2 = sht2.Range("b3:b" & str2)
Dim a As Boolean
For Each c In rng1
a = Application.CountIf(rng2, c) >= 1
If IsEmpty(c) = True Then
c.Interior.Color = xlNone
ElseIf a = True Then
c.Interior.Color = vbGreen
ElseIf a = False Then
c.Interior.Color = vbRed
End If
Next
MsgBox "İşlem tamam!", vbInformation
End Sub
Sub Test()
Application.ScreenUpdating = False
For i = 5 To Cells(Rows.Count, 4).End(3).Row
If Cells(i, 4) = "" Then Cells(i, 4).Interior.Color = xlNone: GoTo 10
Set bul = Sheets("Sayfa2").Range("B2:B100000").Find(Cells(i, 4), , xlValues, xlWhole)
If Not bul Is Nothing Then Cells(i, 4).Interior.Color = vbGreen
If bul Is Nothing Then Cells(i, 4).Interior.Color = vbRed
10
Next
Application.ScreenUpdating = True
MsgBox "Islem tamam..."
End Sub