Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SubTotal when Cell Changes
In my query I would like to have column J (Rentable Square Feet) insert a
subtotal when Owner Entity in Column C changes. Column C Column J Owner Entity Rentable Sq Ft Company A 62,153 Company A 29,951 Company B 125,515 Company B 20,000 Company C 15,81 Company D 103,500 Company D 174,906 I would appreciate any assistance you can give me. Thx. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SubTotal when Cell Changes
The below macro will insert a row and assign the subtotal in Col J. Col C
should not have any blanks... Sub Macro1() Dim lngRow As Long, lngTemp As Long lngRow = 3 lngTemp = lngRow - 1 Do While Range("C" & lngRow) < "" If Range("C" & lngRow) < Range("C" & lngRow - 1) Then Rows(lngRow).Insert Range("J" & lngRow) = "=sum(J" & lngTemp & ":J" & lngRow - 1 & ")" lngRow = lngRow + 1: lngTemp = lngRow End If lngRow = lngRow + 1 Loop Range("J" & lngRow) = "=sum(J" & lngTemp & ":J" & lngRow - 1 & ")" End Sub If this post helps click Yes --------------- Jacob Skaria "KalliKay" wrote: In my query I would like to have column J (Rentable Square Feet) insert a subtotal when Owner Entity in Column C changes. Column C Column J Owner Entity Rentable Sq Ft Company A 62,153 Company A 29,951 Company B 125,515 Company B 20,000 Company C 15,81 Company D 103,500 Company D 174,906 I would appreciate any assistance you can give me. Thx. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Subtotal To Include Item Description On Subtotal Line | 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 | |||
Sort, Subtotal, Label Subtotal, Insert row | Excel Programming |