I have a column B that contains the date, and a column "i" that contains incoming values, a column" j "that contains spent values, and a textbox1 contains a date and a Textbox 2 is required to show the result of collecting column cells, "i". that are smaller than the date in textbox 1, as well as collecting "j"column cells that are smaller than the date of textbox 1, then subtracting the first result from the second and showing it in textbox 2
VBA Code:
Dim m As Double
Set ws = ThisWorkbook.Sheets("kh")
m = prosafty.TextBox1.Value
prosafty.TextBox2.Value = WorksheetFunction.SumIf(ws.Range("b4:b100000"), "<m", ws.Range("i4:i100000")) _
- WorksheetFunction.SumIf(ws.Range("b4:b100000"), "<m", ws.Range("j4:j10000"))