Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing macros in excel sheet Richard Buttrey Excel Worksheet Functions 7 May 10th 06 01:04 AM
Reading data from an excel sheet and writing to another Rain Excel Programming 1 January 19th 05 09:25 AM
Writing value in cell in another sheet John H W[_2_] Excel Programming 4 November 18th 04 07:10 PM
writing to excel sheet Sara Excel Programming 1 September 20th 04 07:02 PM
writing array into excel sheet berrie Excel Programming 1 January 23rd 04 10:15 AM


All times are GMT +1. The time now is 03:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"