Replace active cell

  • Thread starter Thread starter monika
  • Start date Start date
M

monika

HI..

how can i replace ActiveCell.FormulaR1C1 =
"=IF(RC[-20]<>0,RC[-1]/(RC[-20]/100),RC[-1]/0.94)" such as
i dont need to
use RC[-20]...

i have trapped the columns but how to place them in the
above formula....
i tried this ActiveCell.FormulaR1C1 =
"=IF(L3<>0,L4/(L3/100),L4/0.94)" but
it doesnt work..

any suggestion..
Thanks
monika

Set rng2 = Cells.Find("Location") 'FINDING COLUMN
Location
L2 = Left(rng2(1).Address(0, 0), 1 - (rng2(1).Column > 26))
Set rng3 = Cells.Find("Test_Yield") 'FINDING COLUMN
Test_Yield
L3 = Left(rng3(1).Address(0, 0), 1 - (rng3(1).Column > 26))
Set rng4 = Cells.Find("Cum_Jan") 'FINDING COLUMN Cum_Jan
L4 = Left(rng4(1).Address(0, 0), 1 - (rng4(1).Column > 26))

Range(L2 & "2").Select
'Range("BE2").Select
ActiveCell.FormulaR1C1 =
"=IF(RC[-20]<>0,RC[-1]/(RC[-20]/100),RC[-1]/0.94)"
 
Hi Monika
you have to use the R1C1 reference style for your formula or switch to
Activecell.formula. Try
ActiveCell.Formula =" =IF(L3<>0,L4/(L3/100),L4/0.94)"

Frank
 
Back
Top