DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
=ETOPLA($B$2:B2;B2;$C$2:C2)-ETOPLA($B$2:B2;B2;$D$2:D2)
tamamdır ömer bey çok teşekkür ederim.
=ALTTOPLAM(9;$C$2:C3)-ALTTOPLAM(9;$D$2:D3)
Option Explicit
Sub BAKIYE_GUNCELLE()
Dim X As Integer, Say As Integer, Kriter As Variant
Dim Alan As Range, Veri As Range, Son As Long
Dim Bakiye As Double, Zaman As Double
Zaman = Timer
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
If ActiveSheet.AutoFilterMode Then
For X = 1 To ActiveSheet.AutoFilter.Filters.Count
If ActiveSheet.AutoFilter.Filters.Item(X).On Then Say = Say + 1
Next
If Say > 0 Then
Kriter = Evaluate("=INDEX(B2:B1048576,MATCH(1,SUBTOTAL(3,OFFSET(B2:B1048576,ROW(B2:B1048576)-ROW(B2),,1)),0))")
On Error Resume Next
ActiveSheet.ShowAllData
On Error GoTo 0
End If
End If
Son = Cells(Rows.Count, 1).End(3).Row
Range("E2:F" & Rows.Count).ClearContents
If Kriter <> Empty Then Range("A1:F" & Rows.Count).AutoFilter 2, Kriter
Set Alan = Range("A1:A" & Son).SpecialCells(xlCellTypeVisible)
If Not Alan Is Nothing Then
For Each Veri In Alan
If Cells(Veri.Row, "B") <> "" Then
If IsNumeric(Cells(Veri.Row, "C")) Or IsNumeric(Cells(Veri.Row, "D")) Then
Cells(Veri.Row, "E") = Bakiye + (Cells(Veri.Row, "C") - Cells(Veri.Row, "D"))
Bakiye = Cells(Veri.Row, "E")
If Cells(Veri.Row, "E") = 0 Then
Cells(Veri.Row, "F") = Empty
ElseIf Cells(Veri.Row, "E") > 0 Then
Cells(Veri.Row, "F") = "BORÇLU"
Else
Cells(Veri.Row, "F") = "ALACAKLI"
End If
End If
End If
Next
End If
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
MsgBox "İşleminiz tamamlanmıştır." & Chr(10) & "İşlem süresi; " & Format(Timer - Zaman, "0.00") & " Saniye", vbInformation
End Sub
Option Explicit
Sub FILTRELE()
Dim X As Integer, Say As Integer, Kriter As Variant
Dim Alan As Range, Veri As Range, Son As Long
Dim Bakiye As Double, Zaman As Double
Kriter = Application.InputBox("Filtrelemek istediğiniz ismi giriniz.", "KRİTER GİRİŞİ")
If Kriter = "" Or Kriter = False Then Exit Sub
Kriter = "*" & Kriter & "*"
Zaman = Timer
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
If ActiveSheet.AutoFilterMode Then Range("A1").AutoFilter
Son = Cells(Rows.Count, 1).End(xlUp).Row
Range("A1:J" & Son).AutoFilter 6, Kriter
Range("B2:J" & Son).Sort Range("B2"), xlAscending
ActiveSheet.Calculate
If ActiveSheet.AutoFilterMode Then
For X = 1 To ActiveSheet.AutoFilter.Filters.Count
If ActiveSheet.AutoFilter.Filters.Item(X).On Then Say = Say + 1
Next
If Say > 0 Then
Kriter = Evaluate("=INDEX(F2:F1048576,MATCH(1,SUBTOTAL(3,OFFSET(F2:F1048576,ROW(F2:F1048576)-ROW(F2),,1)),0))")
On Error Resume Next
ActiveSheet.ShowAllData
On Error GoTo 0
End If
End If
Son = Cells(Rows.Count, 1).End(3).Row
Range("I2:J" & Rows.Count).ClearContents
If Not IsError(Kriter) Then
If Kriter <> Empty Then Range("A1:J" & Rows.Count).AutoFilter 6, Kriter
End If
Set Alan = Range("A1:A" & Son).SpecialCells(xlCellTypeVisible)
If Not Alan Is Nothing Then
For Each Veri In Alan
If Cells(Veri.Row, "F") <> "" Then
If IsNumeric(Cells(Veri.Row, "G")) Or IsNumeric(Cells(Veri.Row, "H")) Then
Cells(Veri.Row, "I") = Bakiye + (Cells(Veri.Row, "G") - Cells(Veri.Row, "H"))
Bakiye = Cells(Veri.Row, "I")
If Cells(Veri.Row, "I") = 0 Then
Cells(Veri.Row, "J") = Empty
ElseIf Cells(Veri.Row, "I") > 0 Then
Cells(Veri.Row, "J") = "BORÇLU"
Else
Cells(Veri.Row, "J") = "ALACAKLI"
End If
End If
End If
Next
End If
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
MsgBox "İşleminiz tamamlanmıştır." & Chr(10) & Chr(10) & "İşlem süresi ; " & Format(Timer - Zaman, "0.00") & " Saniye", vbInformation
End Sub