LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find String in another string - only between spaces Nir Excel Worksheet Functions 9 November 2nd 06 11:31 AM
Find Many String options in ONE String Nir Excel Worksheet Functions 6 October 26th 06 07:13 AM
Concatenate & Force argument to End of String-(spsjp) SP Excel Worksheet Functions 3 April 2nd 05 03:37 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM
find a string inside another string MarkS Excel Programming 1 January 13th 04 02:55 AM


All times are GMT +1. The time now is 04:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"