Strange error

  • Thread starter Thread starter Filips Benoit
  • Start date Start date
F

Filips Benoit

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
 
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
 
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).
 
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
 
There is no need to change the decimal separator setting. Formula (or in
this case Value) expects US English formatting in VBA.
 

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

Back
Top