Error 1004: application or object defined error

J

jodleren

Hi

I upload a bunch of information to a sheet, including simple formulas
like =A1/A2 etc.

There is one IF, and that causes the error:

Worksheets("Start").Cells(j, 6) = "=if(B7=0;E" & sLine & ";E" &
sLine & "/B7)"

I have tried Worksheets("Start").Cells(j, 6).Formula but that does not
change much
If I remove the equals (=) sign, then it works, and I can add it
afterwards manually, and it will work. The formula is correct, I just
can set it.

I even added a DoEvents before - no change.

What do I do wrong here?
I browsed the group, but did not find anything on this specific case.

WBR
Sonnich
 
J

Jacob Skaria

Worksheets("Start").Cells(j, 6).Formula = "=if(B7=0;E" & sLine & ";E" &
sLine & "/B7)"
 
F

FSt1

hi
if i am reading correctly, your formula seems to have simi colons instead of
commas. try this.
Worksheets("sheet1").Cells(6, "j") = "=if(B7=0,E" & sLine & ",E" & sLine &
"/B7)"

regards
FSt1
 
J

Jacob Skaria

Oops...Review your formula closely to identify the semicolons . It should be
commas
 
J

jodleren

hi
if i am reading correctly, your formula seems to have simi colons insteadof
commas. try this.
Worksheets("sheet1").Cells(6, "j") = "=if(B7=0,E" & sLine & ",E" & sLine &
"/B7)"

regards
FSt1

That was it.
God, I could not see the forest, there were some trees in front of it.

WBR & thanks
Sonnich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top