How do I loop the following formula. If A2=A1 then sum(C2+C1)...keep that going until it is false. I've written the following code but I have to keep writing an IF statement in order for it to keep comparing the A column.
Sub Macro_test()
If [a2].Text = [a1].Text Then
[c1].Value = [b2].Value + [b3].Value
If [a3].Text = [a1].Text Then
[c1].Value = [b3].Value + [b2].Value + [b1].Value
Else: End If
Else: End If
End Sub
how do I keep it going without manually writing it?
Sub Macro_test()
If [a2].Text = [a1].Text Then
[c1].Value = [b2].Value + [b3].Value
If [a3].Text = [a1].Text Then
[c1].Value = [b3].Value + [b2].Value + [b1].Value
Else: End If
Else: End If
End Sub
how do I keep it going without manually writing it?