ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application-defined or object-defined error (https://www.excelbanter.com/excel-programming/428981-application-defined-object-defined-error.html)

jodleren

Application-defined or object-defined error
 
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

Jacob Skaria

Application-defined or object-defined error
 
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
---------------
Jacob Skaria


"jodleren" wrote:

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


jodleren

Application-defined or object-defined error
 
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

On May 27, 11:28*am, Jacob Skaria
wrote:
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
---------------
Jacob Skaria

"jodleren" wrote:
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?





All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com