Hello There,
I am wiritng a macro and got struck badly.
I have a data from Cell C4 to Dxxx (column D is given as xxx because each day the number of rows get changed).
In column E, i have given the below code
Sub Test()
Dim ws As Worksheet
Dim lRow As Long
Set ws = ThisWorkbook.Sheets("Sheet1")
With ws
lRow = .Range("D" & .Rows.Count).End(xlUp).Row
.Range("E4:E" & lRow).Formula = "=If(D4>=0,0,D4)"
.Range("E4:E" & lRow).Value = .Range("E4:E" & lRow).Value
End With
End Sub
Now I am trying to give a Formula in column F but getting struck here...
If Cell E4<>0,Sum($E$3:E4)
when it's comes to Cell E5 and if E5<>0,sum($E$3:E5)
This forumla should be there in all cells which has values in Column E
As said, the number of rows differs each time.
Any assistance is highly appreciated!!!
Thanks!
Bookmarks