View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default how change formula with this code?

You are in R1C1 mode. Change

Cells(i, 6).FormulaR1C1 =
to
Cells(i, 6).Formula =
--
HTH...

Jim Thomlinson


"Ian Elliott" wrote:

Thanks for any help.
I have alot of rows of formula to change, and am trying to speed things up
with the below code. But, when I run this, I get apostrophes where I don't
need them. Any idea why?
For i = 19 To 53
Cells(i, 6).FormulaR1C1 = "=VLOOKUP(D" & i &
",Plan_Group_Month,MONTH(Report_Date)+3, FALSE)"
Next i
But this puts (for example, in row 25) the below in, with apostrophes around
the Dxx.
=VLOOKUP('D25',Plan_Group_Month,MONTH(Report_Date) +3, FALSE)

I tried this too, but got an error
Cells(i, 6).FormulaR1C1 = "=VLOOKUP(D" & Str(i) &
",Plan_Group_Month,MONTH(Report_Date)+3, FALSE)"
Thanks for any help