Click to See Complete Forum and Search --> : VBA String "=Wenn(F43-E43>0;F43-E43;"""")"


Jochen Kauffmann
March 22nd, 2001, 05:40 PM
Hey VB experts,

I want to assign a formula to a cellobject:

Worksheets(4).Cells(43, 11) = "=Wenn(F43-E43>0;F43-E43;"""")"

VBA is not accepting the semicolon in the string. How can I force VBA to compile this expression.
Any answer will be appreciated

Jochen

GungaDin
March 22nd, 2001, 07:10 PM
I don't know what Wenn is but if you are trying to do an if statement, the following should work:

Worksheets(1).Cells(43, 11).Formula = "=IF(F43-E43>0,F43-E43,"""")"

The above code may also work with your Wenn statement.

Hope this helps,

Nathan.