View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
c mateland c mateland is offline
external usenet poster
 
Posts: 52
Default Force VBA countif to find string, not value

Excel 2003

In a VBA routine, I'm trying to do a simple countif.

If Application.WorksheetFunction _
.CountIf(Range("a:a"),"010020") 0 Then

This evaluates to TRUE when I expect FALSE.

In the column it's evaluating, I have...

A
10020
10021
10022

It's obviously counting the 10020 entry, but I want an exact match to
the literal criteria I enter.

How do I force the countif to look for the text string, not the value?

Thanks,
Chuck