Please need help for this case, hope get the answer
thank in advanced
thank in advanced
Attachments

11.7 KB Views: 20
Option Explicit
Sub AskHelp()
Dim c As Range, rng As Range
Dim lr As Long, x As Long
lr = Range("E" & Rows.Count).End(xlUp).Row
Set rng = Range("E3:E" & lr + 1)
x = 0
For Each c In rng
If c <> "" And c.Offset(0, 1) <> "" Then
x = x + c
ElseIf c = "" Then
c = x
x = 0
End If
Next c
End Sub
=IFERROR(SUMPRODUCT(E3:E6,D3:D6^0),"")