Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with EXCEL Formula via VBA

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB
Please help....


I am trying to insert an Excel formula to a table via vba coding as follows:

Code:
Range(15, r.Row).FormulaR1C1 = "=IF(N" & r.Row & "-O" & r.Row & "<=0,0,N" & r.Row & "-O" & r.Row & ")"

but the cells just display the formula as text!!!

Does anyone know what could be causing this?

What am I doing wrong?

Cheers,
Neemi


 
sorry the code I am actually using is

Code:
Range(15, r.Row).Formula = "=IF(N" & r.Row & "-O" & r.Row & "<=0,0,N" & r.Row & "-O" & r.Row & ")"

Please help
 
Range(15, r.Row).Formula = "=...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV...

Thanks for the quick response....

But i am actually using

Range(15, r.Row).Formula = "=...

and it only displays the formula as text!!!
 



Change the format of the cell from TEXT to GENERAL.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Do you, by any chance, have the View option set to "formulas"? (in Excel 2007 that's in the Excel Options>Advanced menue under the curlycue symbol)

_________________
Bob Rashkin
 
I feel dum now!!!
All sorted!!!

Thanks PHV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top