PDA

View Full Version : Solved: Autofilling a formula within row parameters



JZB
05-28-2009, 01:15 AM
Hi Guys

I am trying to autofill a formulae from a first row variable to a last row variable.

I originally only needed to define the last row as the start cell did not change. the start cell in this case was N111 (see below formulae). However now the start cell has changed. :banghead:

Range("N111:N" & Cells(Rows.Count, "A").End(xlUp).Row).FormulaR1C1 = "=R1C1&""_""&RC[-10]"

Is there a way i can change the above formulae to amend N111 to "N" & firstrow.

If not do you guys have another method i can use.

Thanks in advance

JZB

georgiboy
05-28-2009, 01:38 AM
If you have already defined FirstRow then...

Range("N" & FirstRow & ":N" & Cells(Rows.Count, "A").End(xlUp).Row).FormulaR1C1 = "=R1C1&""_""&RC[-10]"

Hope this helps

JZB
05-28-2009, 02:11 AM
spot on - thanks for the help