NADİR YILDIZ
Altın Üye
- Katılım
- 7 Ocak 2006
- Mesajlar
- 1,418
- Excel Vers. ve Dili
- 2016 Türkçe
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Sub Eslesen_Eslesmeyen_Kayitlari_Aktar()
Dim Zaman As Double, S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, WF As WorksheetFunction
Dim Son As Long, Veri As Variant, X As Long, Y As Long, Topla As Double, Alan As Range
Zaman = Timer
Set S1 = Sheets("LİSTE")
Set S2 = Sheets("EŞLEŞENLER")
Set S3 = Sheets("FARKLAR")
Set WF = WorksheetFunction
S1.Range("N:N").ClearContents
S2.Range("A6:K" & S2.Rows.Count).Clear
S3.Range("A6:K" & S3.Rows.Count).Clear
Son = S1.Cells(S1.Rows.Count, 1).End(3).Row
If Son <= 6 Then Son = 7
Veri = Range("A6:M" & Son).Value
For X = LBound(Veri, 1) To UBound(Veri, 1)
If Veri(X, 10) <> 0 Then
For Y = LBound(Veri, 1) To UBound(Veri, 1)
If Veri(Y, 11) <> 0 Then
If S1.Cells(Y + 5, "N") = "" Then
Topla = Topla + Veri(Y, 11)
If Alan Is Nothing Then
Set Alan = S1.Cells(Y + 5, "N")
Else
Set Alan = Union(Alan, S1.Cells(Y + 5, "N"))
End If
If WF.Round(Topla, 2) = WF.Round(Veri(X, 10), 2) Then
S1.Cells(X + 5, "N") = "E"
Alan.Value = "E"
Topla = 0
Set Alan = Nothing
Exit For
End If
End If
Else
Set Alan = Nothing
Topla = 0
End If
Next
End If
Next
S1.Range("A5:N" & S1.Rows.Count).AutoFilter 14, "E"
Son = S1.Cells(S1.Rows.Count, 1).End(3).Row
If Son > 5 Then S1.Range("A5:K" & Son).Copy S2.Range("A5")
S1.Range("A5:N" & S1.Rows.Count).AutoFilter 14, ""
Son = S1.Cells(S1.Rows.Count, 1).End(3).Row
If Son > 5 Then S1.Range("A5:K" & Son).Copy S3.Range("A5")
On Error Resume Next
S1.ShowAllData
On Error GoTo 0
S1.Range("N:N").ClearContents
Set S1 = Nothing
Set S2 = Nothing
Set S3 = Nothing
Set WF = Nothing
MsgBox "Eşleşen ve eşleşmeyen kayıtlar aktarılmıştır." & vbLf & vbLf & _
"İşlem süresi ; " & Format(Timer - Zaman, "0.00") & " Saniye"
End Sub