Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula syntax, "Object-defined error"
Does anyone see anything obviously wrong with the following VB code?
The formula I know to be correct. Is there some syntax missing or something? I'm getting an error: "Application-defined or object-defined error." Thank you in advance. ActiveCell.FormulaR1C1 = _ "=IF(H4<50000,H4*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70),IF(AND(H450000,H4<200000),50 000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+(G4-50000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70),IF(AND(H4200000,H4<500000),5 0000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+150000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70)+(H4-200000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$E$29:$E$70),IF(H4500000,50000*LOOKUP(H4, 'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+150000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70)+200000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$A$29:$A$70)+(H4-500000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$F$29:$F$70)))))" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula syntax, "Object-defined error"
Michael,
If you are using A1 notation, don't assign R1C1 formula ActiveCell.Formula = _ "=IF(H4<50000,H4*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70),IF(AND(H450000,H4<200000),50 000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+(G4-50000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70),IF(AND(H4200000,H4<500000),5 0000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+150000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70)+(H4-200000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$E$29:$E$70),IF(H4500000,50000*LOOKUP(H4, 'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+150000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70)+200000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$A$29:$A$70)+(H4-500000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$F$29:$F$70)))))" -- HTH RP (remove nothere from the email address if mailing direct) wrote in message oups.com... Does anyone see anything obviously wrong with the following VB code? The formula I know to be correct. Is there some syntax missing or something? I'm getting an error: "Application-defined or object-defined error." Thank you in advance. ActiveCell.FormulaR1C1 = _ "=IF(H4<50000,H4*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70),IF(AND(H450000,H4<200000),50 000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+(G4-50000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70),IF(AND(H4200000,H4<500000),5 0000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+150000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70)+(H4-200000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$E$29:$E$70),IF(H4500000,50000*LOOKUP(H4, 'PL Lookup'!$A$29:$A$70,'PL Lookup'!$C$29:$C$70)+150000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$D$29:$D$70)+200000*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$A$29:$A$70)+(H4-500000)*LOOKUP(G4,'PL Lookup'!$A$29:$A$70,'PL Lookup'!$F$29:$F$70)))))" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula syntax, "Object-defined error"
Bless you.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
correct syntax for nesting "if", "and", and "vlookup"....if possib | Excel Worksheet Functions | |||
Adding "And" clause in SQL string causing SQL Syntax error | Excel Programming | |||
What does "Application-defined or object-defined error" mean? | Excel Programming | |||
"Application-defined or object-defined error" while printing excel report | Excel Programming | |||
"Run Time Error 1004 Application Defined or Object Defined Error." | Excel Programming |