View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Formula from VBA to Excel worksheet

cells(1,1).FormulaLocal = sSumFormel

--
Regards,
Tom Ogilvy

"Lars Kofod" wrote in message
...
How do I get this formula from VBA into a cell in an
Excell worksheet.

Code first.
sVSTid = Cells(lRaekke, 7).Address
sHvis = "=+hvis($i$230;$i$23*" & sVSTid
sVSLoen = Cells(lRaekke, 22).Address
sEllers = ";" & sVSLoen & ")"
sSumFormel = sHvis & sEllers
Debug.Print sSumFormel

It gives this formula: =+hvis($i$230;$i$23*$G$46;$V$46)
(danish IF-function)
It keeps failing me no matter what I do. So I must do
something wrong.

Please help me
Lars Kofod