Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Search text & record number of times it appears

Here's a shorter version


Sub CountCells()
Dim findText as String, found as Long
findText = "dog"
Found = application.Countif(worksheets(1).Range("A1:Z26"), _
"*" & findText & "*")
MsgBox "Found " & Found & " instances of " & findText
End sub

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
That was quick. Worked like a charm. Thanks a million

regards,
Julian



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
Count number times text appears in string nc Excel Discussion (Misc queries) 0 May 5th 10 02:41 PM
Count the number of times specific text appears in a column Nannie Excel Worksheet Functions 5 August 27th 08 07:09 PM
Counting the times a number appears Jennifer B[_2_] Excel Discussion (Misc queries) 2 July 17th 08 11:54 PM
count number of times text appears MMcQ Excel Discussion (Misc queries) 3 February 9th 07 07:33 PM
How do I count the number of times a value appears? Christine Excel Worksheet Functions 2 February 8th 07 09:38 PM


All times are GMT +1. The time now is 09:12 AM.

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"