Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default strings in a range

what's a function I can use in VB to count the
number of times a particular string occurs in
a named range of cells?


  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default strings in a range

Application.Countif(Range("myRange"),"string")

as an example

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Peter Morris" <nospam.ple@se wrote in message
. uk...
what's a function I can use in VB to count the
number of times a particular string occurs in
a named range of cells?




  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default strings in a range


"Bob Phillips" wrote in message
...
Application.Countif(Range("myRange"),"string")

as an example

--
HTH


That works.

also, is it possible to use wildcards in the search string?

Or to count the number of cells in the range with ANY
text in?


  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27,285
Default strings in a range

Application.Countif(Range("myRange"),"*string*)

Application.CountA(range("MyRange"))

--
Regards,
Tom Ogilvy


"Peter Morris" <nospam.ple@se wrote in message
. uk...

"Bob Phillips" wrote in message
...
Application.Countif(Range("myRange"),"string")

as an example

--
HTH


That works.

also, is it possible to use wildcards in the search string?

Or to count the number of cells in the range with ANY
text in?



  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default strings in a range


"Tom Ogilvy" wrote in message
...
Application.Countif(Range("myRange"),"*string*)

Application.CountA(range("MyRange"))

--
Regards,
Tom Ogilvy


Brilliant, much gratitude to both of you.


Reply
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
Detect strings in a range Rich57 Excel Worksheet Functions 4 January 1st 08 12:00 AM
strings in a range Peter Morris Excel Worksheet Functions 4 September 5th 06 01:00 AM
Range.Value2 is failing for lenghty strings Naresh Mirkhelkar Excel Programming 4 June 9th 06 02:54 PM
Only allow specified strings in a range Slick Willie Excel Programming 2 September 15th 04 12:27 PM
Concatenate a strings range. y Excel Programming 3 April 26th 04 04:30 AM


All times are GMT +1. The time now is 10:38 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"