CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2000
    Location
    Germany
    Posts
    5

    VBA String "=Wenn(F43-E43>0;F43-E43;"""")"

    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


  2. #2
    Join Date
    Mar 2001
    Location
    Australia
    Posts
    146

    Re: VBA String "=Wenn(F43-E43>0;F43-E43;"""")"

    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.





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured