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 change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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,215,348
Messages
6,124,425
Members
449,157
Latest member
mytux

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