If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Cells(1, 3).Formula = "=IF(B1>0;A1;B1)" -- Error 400

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-21-03, 05:10
MagicBuzz MagicBuzz is offline
Registered User
 
Join Date: Aug 2003
Posts: 2
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.
Reply With Quote
  #2 (permalink)  
Old 08-21-03, 06:31
MagicBuzz MagicBuzz is offline
Registered User
 
Join Date: Aug 2003
Posts: 2
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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