Application-defined or object-defined error

J

jodleren

Hello

This formula causes me trouble.
The sLine is Trim(Str(j)), a line counter.
If I leave out the equals sign (=), and activate the formula
afterwards, it all works well... so the formula is correct.
It only uses the B7 to check for a value, and calculated the H
field... result in I field. There are 6 other (2 complex ones like
this) which does not cause any problems.
The DoEvents was an idea, it does not change much.

DoEvents
Worksheets("Start").Cells(j, 9).Formula = "=IF($B$7=1;H" & sLine &
";((H" & sLine & "/2/$B$7)+((H" & sLine & "/2))+((H" & sLine & "/2)
*0,05)/$B$7))"

BTW; I have no idea what the formula does.... it was given to me...

Any ideas?

WBR
Sonnich
 
J

Jacob Skaria

Try

Worksheets("Start").Cells(j, 9).Formula = "=IF($B$7=1,H" & sLine & ",((H" &
sLine & "/2/$B$7)+((H" & sLine & "/2))+((H" & sLine & "/2)*0.05)/$B$7))"

If this post helps click Yes
 
J

jodleren

It took me some time to see it - you use commas in stead of
semicolons, though Excel changes them back to semicolons....
It works, but I dont get why...

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