Formula error

J

Jithu

Hi,
While trying to run a macro containing the following code-
Range("N1").Formula = CountIf("K" & x, "J" & z - 1, "yes") / CountIf("L" &
x, "L" & z - 1, "yes")

error appears saying sub ar function not defined
can anyone please help me in this...

Thanks in advance for your posts

jithu
 
T

Toppers

try:

Range("N1").Formula = "=CountIf(K" & x & ":J" & z - 1 &
",""yes"")/CountIf(L" & x & ":L" & z - 1 & ",""yes"")"
 
Top