Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am not familiar with the DataSubTotals menu, and don't know how it
works... However, I came up with a solution that works. I basically create a string with the formula I want to insert, like this: (selection is column A) a = 0 Str1 = "=SUM(R[-" For Each b In selection.Cells If Left(b.Value, 1) = " " Then ... here I copy the easy "=B1*C1" formula Else Str1 = Str1 + Trim(Str(a)) + "]C:R[-1]C)" b.Offset(0, 3).FormulaR1C1 = Str1 a = -1 Str1 = "=SUM(R[-" End If a = a + 1 Next Every time I put the sum formula for the cells above, I restart the Str1 and a variables. It works beautifully! Thanks anyway! Jose On Jun 13, 12:59 am, "NickHK" wrote: That should be : Maybe add a column for "Family", then look at DataSubTotals menu. NickHK "NickHK" wrote in message ... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select range and put range address in variable | Excel Programming | |||
Macro to copy a specified range to a variable range | Excel Programming | |||
Range Variable ? | Excel Programming | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
Problem trying to us a range variable as an array variable | Excel Programming |