View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Worksheet Function countif

I think you just needed more double quotes around Summary. the worksheet
function whant tho se double quotes and excel is removing these quotes

Set Myrange = Worksheets("Sheet1").Range("a1, a" & nrows)
NumberOfSummaries = Application.WorksheetFunction.CountIf(Myrange,
"""SUMMARY:""")


"Hydra" wrote:

Set Myrange = Worksheets("Sheet1").Range("a1, a" & nrows)
NumberOfSummaries = Application.WorksheetFunction.CountIf(Myrange,
"SUMMARY:")

this throws and error that says "Unable to get countif function of the
worksheet function class"

Any idea what I'm doing wrong?