Thread: countif
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default countif

Not sure about how where you say "Zanesville" will be found works out with
your .Cells(i-1,"A").Value reference, but assuming your attempted formula is
using the correct referenced parts, see if this works for you...

..Cells(i, "E").Formula = "=COUNTIF(A1:A" & LastRow & ",""" & _
.Cells(i - 1, "A").Value & """)"

--
Rick (MVP - Excel)


"Bob" wrote in message
...
I would like to incorporate the formula COUNTIF(A1:A472,"Zanesville") in my
macro

Zanesville would be filled in from the last row of data in the row the
formula appears

I thought something like (which doesn't work):

.Cells(i, "E").Formula = "=countif(A1:A" & LastRow & """" & _
.Cells(i - 1, "A").Value & """))"