Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003

    Unanswered: Cells(1, 3).Formula = "=IF(B1>0;A1;B1)" -- Error 400

    When I type this very simple instruction, I get a blank popup indicating "400".

    Cells(1, 3).Formula = "=IF(B1>0;A1;B1)"

    I found on MSDN this error code indicates the form is already active and can't be modal... But I don't have form !

    How do to this work ?

    When I try :

    Cells(1, 3).Formula = "=SUM(A1:B1)"

    I don't have any problem.

    Excel 2000
    Last edited by MagicBuzz; 08-21-03 at 06:25.

  2. #2
    Join Date
    Aug 2003
    OK... Amazing...

    I found the solution, Excel is simply crazy.

    When we type a formula in a cell, it replaces the "," parameter separator with ";".

    BUT when we type the value from VBA, it must be ","...
    So :

    Cells(1, 3).Formula = "=IF(B1>0,A1,B1)"

    It works

Posting Permissions

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