- Katılım
- 21 Haziran 2021
- Mesajlar
- 64
- Excel Vers. ve Dili
- türkçe
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub Karsilastir()
Dim S1 As Worksheet, S2 As Worksheet, c As Range, sat As Long, i As Long
Set S1 = Sheets("MUHASEBE")
Set S2 = Sheets("PORTAL")
Application.ScreenUpdating = False
Sheets("SONUÇ").Select
Range("A2:B" & Rows.Count) = ""
sat = 2
For i = 2 To S2.Cells(Rows.Count, "D").End(xlUp).Row
Set c = S1.[A:A].Find(S2.Cells(i, "D"), , xlValues, xlWhole)
If c Is Nothing Then
Cells(sat, "A") = S2.Cells(i, "D")
Cells(sat, "B") = "Muhasebede Yok"
sat = sat + 1
End If
Next i
For i = 2 To S1.Cells(Rows.Count, "A").End(xlUp).Row
Set c = S2.[D:D].Find(S1.Cells(i, "A"), , xlValues, xlWhole)
If c Is Nothing Then
Cells(sat, "A") = S1.Cells(i, "A")
Cells(sat, "B") = "Portalde Yok"
sat = sat + 1
End If
Next i
If sat = 2 Then MsgBox "Eksik Kayıt Yok."
Application.ScreenUpdating = True
End Sub
Peki bunu nasıl deneyim. Yani hangi sayfaya makro atayacam tarif eder misiniz.?Merhaba,
Benim anladığım.
Kod:Sub Karsilastir() Dim S1 As Worksheet, S2 As Worksheet, c As Range, sat As Long, i As Long Set S1 = Sheets("MUHASEBE") Set S2 = Sheets("PORTAL") Application.ScreenUpdating = False Sheets("SONUÇ").Select Range("A2:B" & Rows.Count) = "" sat = 2 For i = 2 To S2.Cells(Rows.Count, "D").End(xlUp).Row Set c = S1.[A:A].Find(S2.Cells(i, "D"), , xlValues, xlWhole) If c Is Nothing Then Cells(sat, "A") = S2.Cells(i, "D") Cells(sat, "B") = "Muhasebede Yok" sat = sat + 1 End If Next i For i = 2 To S1.Cells(Rows.Count, "A").End(xlUp).Row Set c = S2.[D:D].Find(S1.Cells(i, "A"), , xlValues, xlWhole) If c Is Nothing Then Cells(sat, "A") = S1.Cells(i, "A") Cells(sat, "B") = "Portalde Yok" sat = sat + 1 End If Next i If sat = 2 Then MsgBox "Eksik Kayıt Yok." Application.ScreenUpdating = True End Sub