Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How would I code a macro to have it -sum()
Afterwards Col E should total 0.00 In Cell E426 -754.05 E422 -5,409.85 << I have several groups like this between Row 6 and 427 E420 -13,397.65 E418 -4,132.69 E6 -60.00 I've been trying to alter similar code, but without success. Thanks in Advance.. Row# Col E 6 7 60.00 ..... 418 419 4132.69 420 421 13397.65 422 423 2365.13 424 1522.36 425 1522.36 426 427 754.05 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub MakeNegatives()
Dim lastrow as Long, i as Long Dim sm as double lastrow = cells(rows.count,"E").End(xlup).Row for i = lastrow to 6 step - 1 if not isempty(cells(i,"E")) then sm = sm + cells(i,"E") else cells(i,"E").Value = -1 * sm sm = 0 end if Next End Sub Untested, but this should get you started. -- Regards, Tom Ogilvy "Jim May" wrote: How would I code a macro to have it -sum() Afterwards Col E should total 0.00 In Cell E426 -754.05 E422 -5,409.85 << I have several groups like this between Row 6 and 427 E420 -13,397.65 E418 -4,132.69 E6 -60.00 I've been trying to alter similar code, but without success. Thanks in Advance.. Row# Col E 6 7 60.00 ..... 418 419 4132.69 420 421 13397.65 422 423 2365.13 424 1522.36 425 1522.36 426 427 754.05 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot Totals: Group totals different from Grand totals | Excel Discussion (Misc queries) | |||
Inserting Totals into Worksheet | Excel Worksheet Functions | |||
Move the negaive symbol from the right to the left side of a numbe | Excel Worksheet Functions | |||
Looping Macro to enter negative totals | Excel Programming | |||
Comparing/matching totals in a column to totals in a row | Excel Worksheet Functions |