Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Would this work?
Sub Demo() Dim LastRow As Long LastRow = 20 Cells(LastRow + 2, 4).Resize(1, 6).FormulaR1C1 = "=SUM(R13C:R[-2]C)" End Sub It reads like this: Sum from Row 13, same column, to 2 rows above reference, same column. -- HTH :) Dana DeLouis Windows XP & Excel 2007 "mohavv" wrote in message ... Hi, I have a feeling that this part of my macro can be done simpler. But I don't know how. Range("D" & LastRow + 2).Formula = "=sum(D13:D" & LastRow & ")" Range("E" & LastRow + 2).Formula = "=sum(E13:E" & LastRow & ")" Range("F" & LastRow + 2).Formula = "=sum(F13:F" & LastRow & ")" Range("G" & LastRow + 2).Formula = "=sum(G13:G" & LastRow & ")" Range("H" & LastRow + 2).Formula = "=sum(H13:H" & LastRow & ")" Range("I" & LastRow + 2).Formula = "=sum(I13:I" & LastRow & ")" Thanks in advance for your help. Cheers, Harold |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simpler Formula ... 2nd lowest value? | Excel Worksheet Functions | |||
Complex formula vs. simpler | Excel Worksheet Functions | |||
Excel should have a simpler subtraction formula similar to "sum". | Excel Worksheet Functions | |||
QUESTION- Simpler Way to Add a Data Series to Other Graphs? | Excel Discussion (Misc queries) | |||
Another (simpler?) printing problem | Excel Discussion (Misc queries) |