Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
One way Enter in B2 =IF(A3="",SUM($A$1:A2)-SUM($B$1:B1),"") and copy down -- Regards Roger Govier "Alam" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Roger Govier" wrote: Hi One way Enter in B2 =IF(A3="",SUM($A$1:A2)-SUM($B$1:B1),"") and copy down -- Regards Roger Govier "Alam" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,Mr. Joel
Thanks it is great, and if you dont mind there is small request, I want this same Macro idea to be Macro in UDF. Thanks & Regards "Joel" wrote: 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 "Roger Govier" wrote: Hi One way Enter in B2 =IF(A3="",SUM($A$1:A2)-SUM($B$1:B1),"") and copy down -- Regards Roger Govier "Alam" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Doing this functtion in UDF has no advantae than just using a SUM worksheet
function. "Alam" wrote: Hi,Mr. Joel Thanks it is great, and if you dont mind there is small request, I want this same Macro idea to be Macro in UDF. Thanks & Regards "Joel" wrote: 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 "Roger Govier" wrote: Hi One way Enter in B2 =IF(A3="",SUM($A$1:A2)-SUM($B$1:B1),"") and copy down -- Regards Roger Govier "Alam" wrote in message ... 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok right, thanks for your help.
"Joel" wrote: Doing this functtion in UDF has no advantae than just using a SUM worksheet function. "Alam" wrote: Hi,Mr. Joel Thanks it is great, and if you dont mind there is small request, I want this same Macro idea to be Macro in UDF. Thanks & Regards "Joel" wrote: 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 "Roger Govier" wrote: Hi One way Enter in B2 =IF(A3="",SUM($A$1:A2)-SUM($B$1:B1),"") and copy down -- Regards Roger Govier "Alam" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtotal To Include Item Description On Subtotal Line | Excel Discussion (Misc queries) | |||
sort macro, subtotal and add lines after subtotal | Excel Discussion (Misc queries) | |||
pasting to subtotal lines without replacing hidden -non-subtotal l | Excel Discussion (Misc queries) | |||
Bolding the subtotal lines automaticlly When using the Subtotal fu | New Users to Excel | |||
Subtotal of Subtotal displays Grand Total in wrong row | Excel Worksheet Functions |