ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   writing a formular into one cell of an excel sheet (https://www.excelbanter.com/excel-programming/336223-writing-formular-into-one-cell-excel-sheet.html)

Matthias Frohnapfel

writing a formular into one cell of an excel sheet
 
Hello,

I've a VBA Macro. This should write a formular like

=wenn(xy;"ja";"nein")

in a cell. I tried this: Range("B9").value = "=wenn(xy;"ja";"nein")"

I think there is also a problem with executing this formular. Can somebody
help me, please?

Thank you!



Norman Jones

writing a formular into one cell of an excel sheet
 
Hi Matthias,

The quotation marks inside you IF formula need to be doubled, i.e.

Change: "=wenn(xy;"ja";"nein")"

to: "=wenn(xy,""ja"",""nein"")"


Of course this IF formula will return an error unless xy represents a
logical condition which the worksheet can evaluate.


---
Regards,
Norman



"Matthias Frohnapfel" wrote in message
...
Hello,

I've a VBA Macro. This should write a formular like

"=wenn(xy;"ja";"nein")"

in a cell. I tried this: Range("B9").value = "=wenn(xy;"ja";"nein")"

I think there is also a problem with executing this formular. Can
somebody
help me, please?

Thank you!





Matthias Frohnapfel

writing a formular into one cell of an excel sheet
 
Hello,

there is still an error. This is my real formula:

Range("B9").Value = "=WENN(B28(B22+0,75*(B29-B22));""ja"";""nein"")"

I want to write the formula =WENN(B28(B22+0,75*(B29-B22));""ja"";""nein"")
into a cell. After that, Excel should execute this formula, so that I get
"ja" or "nein".

Thank you!



Norman Jones

writing a formular into one cell of an excel sheet
 
Hi Matthias,

The English version of your formula is :

=IF(B28(B22+0.75*(B29-B22)),"ja","nein")

Using the VBA expression:

Range("B9").Value = "=IF(B28(B22+0.75*(B29-B22)),""ja"",""nein"")"

returns ja (or nein) in cell B9 for me.

As I have an English version of Excel, I cannot test, but I can see no
reason why, if the equuivalent German worksheet function exprssion:

=WENN(B28(B22+0,75*(B29-B22));"ja";"nein")

works, the VBA expression:

Range("B9").Value = "=WENN(B28(B22+0,75*(B29-B22));""ja"";""nein"")"

should return an error.


---
Regards,
Norman



"Matthias Frohnapfel" wrote in message
...
Hello,

there is still an error. This is my real formula:

Range("B9").Value = "=WENN(B28(B22+0,75*(B29-B22));""ja"";""nein"")"

I want to write the formula
=WENN(B28(B22+0,75*(B29-B22));""ja"";""nein"")
into a cell. After that, Excel should execute this formula, so that I get
"ja" or "nein".

Thank you!






All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com