DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Sub RAPOR()
Dim X As Long, S1 As Worksheet, S2 As Worksheet, İlk As Long, Son As Long
Application.ScreenUpdating = False
Set S1 = Sheets("GUNLUK")
S1.Range("F4:J" & Rows.Count).ClearContents
For X = 4 To S1.Cells(Rows.Count, "D").End(3).Row
Set S2 = Sheets(S1.Cells(X, "D").Text)
If WorksheetFunction.CountIf(S2.Range("C:C"), S1.Range("I1")) > 0 Then
İlk = Evaluate("=MIN(IF(" & S2.Name & "!C8:C1000=I1,Row(" & S2.Name & "!C8:C1000),""""))")
Son = Evaluate("=MAX(IF(" & S2.Name & "!C8:C1000=I1,Row(" & S2.Name & "!C8:C1000),""""))")
If İlk > 0 And Son > 0 Then
S1.Cells(X, "F") = S2.Cells(İlk, "D") & " / " & S2.Cells(Son, "D")
S1.Cells(X, "G") = S2.Cells(İlk, "E") & " / " & S2.Cells(Son, "E")
S1.Cells(X, "H") = Evaluate("=SUMPRODUCT((" & S2.Name & "!C8:C1000=I1)*(" & S2.Name & "!D8:D1000<>""""))")
S1.Cells(X, "I") = Evaluate("=SUMPRODUCT((" & S2.Name & "!C8:C1000=I1)*(" & S2.Name & "!D8:D1000<>"""")*(" & S2.Name & "!E8:E1000=""İPTAL""))")
S1.Cells(X, "J") = S1.Cells(X, "H") - S1.Cells(X, "I")
End If
End If
Next
Set S1 = Nothing
Set S2 = Nothing
Application.ScreenUpdating = True
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub