Set a cells Formula using VBA?

Hi there,

I'm not quite used to blogs... yea I'm a little old! I am running in a problem with Excel Range.formula. Here is part of my code :

CODE_____________________________________________

TEMP_string = "=COUNTIF(" & .Range("DF_Donnees").Address & ";" & """<""" & "&" & AdresNivRel(.Range("DF_ClasMin").Offset(-Counter, 1).Address, 3) & ")"
.Range("DF_ClasMin").Offset(-Counter, 3).Formula = TEMP_string

ENDCODE____________________________________________

TEMP_String gives me exactly what I want "=COUNTIF("$A$37:$J$2007";"<"&"C15) but I get an error message #1004 error difined by application or object.... I am quite at a loss here. Any help would be great.

Rgds
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Replace the semicolons with commas in your formula string - VBA defaults to US regional settings.

PS This isn't a blog, but welcome to the forum. :)
 
Upvote 0
I'm good! I found it.... in french the delimiter for parameters is ";" and in english it's ","....
 
Upvote 0

Forum statistics

Threads
1,213,558
Messages
6,114,297
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top