As figure shown below I want the sub total shown on right side of figure
column, to be automatically calculated by Excel formula or VBA macro.(e.g
when the empty cell appear in the figure column accordingly subtotal
calculated in right side of the figure column.
1,710.60
1,661.10 3,371.70
2,404.00
1,020.00
1,907.40
1,753.08
2,560.30
2,825.90 12,470.68
1,965.60
1,625.60 3,591.20
2,302.20 2,302.20
2,429.10 2,429.10
2,006.40 2,006.40
Regards
Roger Govier - 09 Dec 2007 09:40 GMT
Hi
One way
Enter in B2
=IF(A3="",SUM($A$1:A2)-SUM($B$1:B1),"")
and copy down

Signature
Regards
Roger Govier
> As figure shown below I want the sub total shown on right side of figure
> column, to be automatically calculated by Excel formula or VBA macro.(e.g
[quoted text clipped - 21 lines]
>
> Regards
Joel - 09 Dec 2007 12:30 GMT
Here is a simple macro
Sub add_totals()
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
FirstRow = 1
For RowCount = 1 To LastRow
If Range("A" & (RowCount + 1)) = "" Then
Range("B" & RowCount).Formula = _
"=sum(A" & FirstRow & ":A" & RowCount & ")"
End If
If Range("A" & RowCount) = "" Then
FirstRow = RowCount + 1
End If
Next RowCount
End Sub
> Hi
>
[quoted text clipped - 28 lines]
> >
> > Regards
Alam - 10 Dec 2007 04:53 GMT
Hi,Mr. Joel
Thanks it is great, and if you don’t mind there is small request, I want
this same Macro idea to be Macro in UDF.
Thanks & Regards
> Here is a simple macro
>
[quoted text clipped - 46 lines]
> > >
> > > Regards
Joel - 10 Dec 2007 11:30 GMT
Doing this functtion in UDF has no advantae than just using a SUM worksheet
function.
> Hi,Mr. Joel
> Thanks it is great, and if you don’t mind there is small request, I want
[quoted text clipped - 51 lines]
> > > >
> > > > Regards
Yousoft - 10 Dec 2007 12:44 GMT
Ok right, thanks for your help.
> Doing this functtion in UDF has no advantae than just using a SUM worksheet
> function.
[quoted text clipped - 54 lines]
> > > > >
> > > > > Regards