ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Strange error (https://www.excelbanter.com/excel-programming/314150-strange-error.html)

Filips Benoit

Strange error
 
Dear All,


ActiveSheet.Cells(iloop, 5).Value = "=Sum(F688:F727)*0,05"
This line triggers error 1004 Application defined or object difined error

\/
ActiveSheet.Cells(iloop, 5).Value = "Sum(F688:F727)*0,05"
If i ommit the = before Sum there is no error but the formular is not
correct!!

How do i solve this

Filip





Don Guillett[_4_]

Strange error
 
try

ActiveSheet.Cells(iloop, 5).Value = "=Sum(F688:F727)*0,05"


ActiveSheet.Cells(iloop, 5)= application.Sum(range("F688:F727"))*1
or
ActiveSheet.Cells(iloop, 5).Value = application.Sum(range("F688:F727"))*1

--
Don Guillett
SalesAid Software

"Filips Benoit" wrote in message
...
Dear All,


ActiveSheet.Cells(iloop, 5).Value = "=Sum(F688:F727)*0,05"
This line triggers error 1004 Application defined or object difined error

\/
ActiveSheet.Cells(iloop, 5).Value = "Sum(F688:F727)*0,05"
If i ommit the = before Sum there is no error but the formular is not
correct!!

How do i solve this

Filip







kkknie[_243_]

Strange error
 

I get the same error. Could it be that your regional settings are no
correct? I notices that you use 0,05 which will not work on my PC. I
I change your code to use 0.05, it works for me.

Go to Tools menu and select options. Check the International tab an
make sure decimal separator is set to comma (assuming that's what yo
use where you live).



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=27084


Tom Ogilvy

Strange error
 
ActiveSheet.Cells(iloop, 5).Formula = "=Sum(F688:F727)*0.05"

Change the comma to a period.

Value would still work, but it is clearer to use Formula

--
Regards,
Tom Ogilvy




"Filips Benoit" wrote in message
...
Dear All,


ActiveSheet.Cells(iloop, 5).Value = "=Sum(F688:F727)*0,05"
This line triggers error 1004 Application defined or object difined error

\/
ActiveSheet.Cells(iloop, 5).Value = "Sum(F688:F727)*0,05"
If i ommit the = before Sum there is no error but the formular is not
correct!!

How do i solve this

Filip







Tom Ogilvy

Strange error
 
There is no need to change the decimal separator setting. Formula (or in
this case Value) expects US English formatting in VBA.

--
Regards,
Tom Ogilvy

"kkknie" wrote in message
...

I get the same error. Could it be that your regional settings are not
correct? I notices that you use 0,05 which will not work on my PC. If
I change your code to use 0.05, it works for me.

Go to Tools menu and select options. Check the International tab and
make sure decimal separator is set to comma (assuming that's what you
use where you live).

K


--
kkknie
------------------------------------------------------------------------
kkknie's Profile:

http://www.excelforum.com/member.php...fo&userid=7543
View this thread: http://www.excelforum.com/showthread...hreadid=270849




kkknie[_244_]

Strange error
 

Wow. That's not very "internationally correct". :)



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=27084


Tom Ogilvy

Strange error
 
formulaLocal

will work with a localized formula. Where's the problem?

--
Regards,
Tom Ogilvy

"kkknie" wrote in message
...

Wow. That's not very "internationally correct". :)

K


--
kkknie
------------------------------------------------------------------------
kkknie's Profile:

http://www.excelforum.com/member.php...fo&userid=7543
View this thread: http://www.excelforum.com/showthread...hreadid=270849




Filips Benoit

Strange error
 
Changing the comma to a period did the job.

Thanks

"Tom Ogilvy" wrote in message
...
ActiveSheet.Cells(iloop, 5).Formula = "=Sum(F688:F727)*0.05"

Change the comma to a period.

Value would still work, but it is clearer to use Formula

--
Regards,
Tom Ogilvy




"Filips Benoit" wrote in message
...
Dear All,


ActiveSheet.Cells(iloop, 5).Value = "=Sum(F688:F727)*0,05"
This line triggers error 1004 Application defined or object difined

error

\/
ActiveSheet.Cells(iloop, 5).Value = "Sum(F688:F727)*0,05"
If i ommit the = before Sum there is no error but the formular is not
correct!!

How do i solve this

Filip










All times are GMT +1. The time now is 04:22 AM.

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