Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 22 different classes in Column F, each class may have 1-25 item rows.
I need to locate the last row of each class and insert a row below it (22 new rows inserted throughout the sheet). Then I need it to sum the dollar amounts located in Column AI in the new row for all of the items in each class. I hope you can help. Thank you, ~Robert |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
1) make sure each column has a title (column F will be called class)
2) sort by column F (class) ascending 3) use data subtotals at each change in Class use function SUM apply to columns AI (dollars) then hit OK Excel adds the subtotals and extra rows for you. You can get a group level summary by clicking 1,2,3 on the left -- Allllen "rlee1999" wrote: I have 22 different classes in Column F, each class may have 1-25 item rows. I need to locate the last row of each class and insert a row below it (22 new rows inserted throughout the sheet). Then I need it to sum the dollar amounts located in Column AI in the new row for all of the items in each class. I hope you can help. Thank you, ~Robert |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub SumClasses()
Dim iLastRow As Long Dim i As Long Dim tmp iLastRow = Cells(Rows.Count, "F").End(xlUp).Row tmp = "" For i = iLastRow To 1 Step -1 If Cells(i, "F").Value < tmp Then tmp = Cells(i, "F").Value Rows(i + 1).Insert Cells(i + 1, "F").Formula = "=SUMIF(F1:F" & i & ",""" & tmp & """,AI1:AI" & i & ")" End If Next i End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "rlee1999" wrote in message ... I have 22 different classes in Column F, each class may have 1-25 item rows. I need to locate the last row of each class and insert a row below it (22 new rows inserted throughout the sheet). Then I need it to sum the dollar amounts located in Column AI in the new row for all of the items in each class. I hope you can help. Thank you, ~Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can any help with a little script | Excel Programming | |||
VB script help - please!! | Excel Discussion (Misc queries) | |||
VB script help..please !! | Excel Worksheet Functions | |||
Excel 2000/XP script to Excel97 script | Excel Programming | |||
VB Script Help | Excel Programming |