Macro and Count function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am recording a macro in Excel 2003 (do not know or use VBA Editor) that
involves many different tasks in the worksheet. When I run the macro, it
runs everything except the CountIF function I recorded. I am using the
function to capture the number of times certain text appears in a column.
Any assistance on getting the macro to record the function?

Thanks.
 
Do you want the formula inserted

Activecell.Formula = "=COUNTIF(A1,A20,""some value"")"

or get the result

Msgbox Application.Countif(Range("A1:A20"),"some value")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
n = Application.CountIf(Range("A:A"), Range("B1"))



In VBA COUNTIF() needs to be spoon-fed the range.
 

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