hi expert
I need efficient way to decrease the list of many customers which contain value is zero and any value precede zero so every time it the balance reaches to zero when pay the debit and again the balance become not zero so what I want ignore the earlier balances which zero and relating of it as you see in sheet "account" highlighted by yellow color should ignore them and I expected result in sheet result it depends on COL E
which value contains zero and any value precede zero should ignore it , and I have this macro but it only ignores the row contains zero in COL E
I know this is complicated request , any suggestion do that automatically, please ?
Code
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) <> "B1" Then Exit Sub
Dim Rg As Range
Set Rg = [result!G1:H2]
Rg = Application.Index(Array(Array("account2", "balance"), Array([B1], "<>0")), 0, 0)
[A5].CurrentRegion.AdvancedFilter 2, Rg, [result!A6:H6]
Rg.ClearContents
With Sheets("result")
.[A2:D3] = [account!C2:F3].Value
.[B1] = Target.Value
End With
End Sub
Display More