PDA

Click to See Complete Forum and Search --> : what's wrong with that - Resolved


BrandonSk
Sep 21st, 2004, 09:44 AM
hi everyone...

Excel macro... trying to insert formula into the cell using this code:

Range("G4").Formula = "=TEXT(D4;""0#"") & "" - "" & Output!B4"

The formula inserted should be this:
=TEXT(D4;"0#") & " - " & Output!B4
which is exactly what you get when you do Debug.Print with the above line.
It works on the sheet when I manually input the formula.

But when I run it in the code, I get an error. Any ideas?

Thanx,

Brandon.

SOLUTION:
Hmm... strange, but obiously this works:
:thumb:
Range("G4").FormulaLocal = "=TEXT(D4;""0#"") & "" - "" & Output!B4"