Runtime error 1004: Application-defined or object-defined error.

Fuga

Registered User.
Local time
Tomorrow, 00:04
Joined
Feb 28, 2002
Messages
566
I run a macro on an excel sheet. The error comes up on line 2 in this segment. (the formula line)

Range("al15").Select
ActiveCell.Formula = "=IF(N15>MIN(O15:R15);(IF(AND((S14>U14);(S15<U15));(IF(AND((T14>V14);(T15<V15));N15;0));0));0)"
Range("al15:al" & introws).Select
Selection.FillDown

I can type in the formula and it works fine. Why can´t I set it like this in VBA?

Fuga.
 
Are you trying to do this in Access's VBA? If so, it will not work, as you have discovered. You will need to create code to do what you want....

Jack
 
Fuga, replace the separator ; in your formula with ,
 
Thank you guys.

Jack,

It is a macro in excel. I have it stored in one workbook and run it on other workbooks. Access is not involved at all actually.


Bert,
I tried your suggestion, but unfortunately it didn´t work.

The thing is, when I do it manually, i e write the formula and then fill it down, it works.

Just had an idea: I can try using the macro recorder in stead of the vba editor. I´ll get back to you.

Fuga.
 
Ok, now it works.

When I use the recorder, it uses the activecell.formular1c1 in stead of activecell.formula.

Does anyone know why this is? I have changed from formular1c1 to just formula before.

Fuga.
 
Sorry, I don't Excel or macros so I haven't a clue. Maybe someone else will have the answer....

Jack
 

Users who are viewing this thread

Back
Top Bottom