PDA

View Full Version : Solved: Summing same row twice.



ksquirt
02-05-2009, 08:17 AM
I haven't figured out how to read formulas in macros yet. This line is adding in row 5 twice. Can anybody tell me why?

Range("L10").FormulaR1C1 = "=SUM(R[10]C:R[1000]C)" 'FYF

ksquirt
02-05-2009, 08:40 AM
This works properly, but I'd like to understand why the first one doesn't. It should sum the five rows above it, but it was doubling row 5.

"=SUM(R[-5]C:R[-1]C)"

ksquirt
02-05-2009, 09:15 AM
I changed it to the below and now it works. Thanks for viewing my question!



Range("L10").FormulaR1C1 = "=SUM(R[11]C:R[1000]C)" 'FYF

mdmackillop
02-05-2009, 05:02 PM
I've read the question, but don't understand the problem or the solution!

Bob Phillips
02-06-2009, 05:39 AM
Nor me, neither formula gets anywhere near row 5, they start at L20 or L21.