Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding Totals...Continued
Hi,
First of all I am very sorry for forgetting to attach my code to my previous email so here it is: For Each categ1 In Category.Cells If (categ1.Value < "") Then If (categ1.Value = categ1.Offset(1, 0).Value) Then 'working on later ElseIf (categ1.Offset(1, 0).Value < "") And (categ1.Value < categ1.Offset(1, 0).Value) Then categ1.Activate ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select Selection.Insert Shift:=xlDown ElseIf (categ1.Offset(1, 0).Value = "") And (start 1) Then 'I used the start counter to skip the first empty cell 'the last row total categ1.Activate ActiveCell.Offset(1, 0).Rows ("1:1").EntireRow.Select Selection.Insert Shift:=xlDown CatTot = CatTot + 1 'CatTot is my counter for CatTot to use for my formula categ1.Offset(1, 0).Value = "Total " categ1.Offset(1, 1).Value = categ1.Value 'diff2 is how much to move right of the cell categ1.Offset(1, diff2).Activate ActiveCell.FormulaR1C1 = "=SUM(R[" + Str(-CatTot) + "]C:R[-1]C)" End If start = start + 1 CatTot = CatTot + 1 ElseIf (categ1.Value = "") And (start 1) Then categ1.Value = "Total " categ1.Offset(0, 1).Value = categ1.Offset(- 1, 0).Value categ1.Offset(0, diff2).Activate ActiveCell.FormulaR1C1 = "=SUM(R[" + Str(- CatTot) + "]C:R[-1]C)" 'Exit For End If Next categ1 Thank you in advance, LC |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Average With < Continued | Excel Worksheet Functions | |||
Excel Function . . . Continued | Excel Discussion (Misc queries) | |||
Median continued | Excel Discussion (Misc queries) | |||
Pivot Totals: Group totals different from Grand totals | Excel Discussion (Misc queries) | |||
If then statement continued! | Excel Discussion (Misc queries) |