Thread: Formulas
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Abilio Abilio is offline
external usenet poster
 
Posts: 22
Default Formulas

do You mean after & ? if so, It didn't work.

"Martin Krastev" wrote:

I guess you will have to put a dot (".") before Cells!

"Abilio" wrote:

I have this formula that calculates correctly the sheet1 but for some reason
it doesn't calculates the sheet2. I'd appreciate the help.



Function Projection() 'This step calculates projections, it should be
'done in both of the Sheet1 and Sheet2.

With Worksheets("Sheet1")
.Range("Q2:Q" & Cells(.Rows.Count, 8).End(xlUp).Row).FormulaR1C1 = _
"=IF(RC[-5]=0,-999999,(RC[-4]/(RC[-5]*RC[-9]))*13300)"
End With
With Worksheets("Sheet2")
.Range("Q2:Q" & Cells(.Rows.Count, 8).End(xlUp).Row).FormulaR1C1 = _
"=IF(RC[-5]=0,-999999,(RC[-4]/(RC[-5]*RC[-9]))*13300)"
End With
End Function