Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
re-occuring text 99
Does anyone know of a function in VBA that counts number of time text
re-occurs in a string. ie Test String ... T appears 3 times. I wrote a function that does a character by character check but its very slow when checking large amounts of data. Thank you (if this post appears twice its because my comp keeps bombing) -- Ray |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
re-occuring text 99
=LEN(A1)-LEN(SUBSTITUTE(LOWER(A1),"t",""))
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Ray" wrote in message ... Does anyone know of a function in VBA that counts number of time text re-occurs in a string. ie Test String ... T appears 3 times. I wrote a function that does a character by character check but its very slow when checking large amounts of data. Thank you (if this post appears twice its because my comp keeps bombing) -- Ray |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
re-occuring text 99
if you want VBA
Function CountOccurances(val As String, check As String) CountOccurances = Len(val) - _ Len(Replace(LCase(val), LCase(check), "")) End Function -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Ray" wrote in message ... Does anyone know of a function in VBA that counts number of time text re-occurs in a string. ie Test String ... T appears 3 times. I wrote a function that does a character by character check but its very slow when checking large amounts of data. Thank you (if this post appears twice its because my comp keeps bombing) -- Ray |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2nd most frequently occuring value | Excel Discussion (Misc queries) | |||
run programme error occuring | Excel Worksheet Functions | |||
Custom function to search a string of text for certain values occuring within it | Excel Programming | |||
Extracting the most frequently occuring text from a range | Excel Worksheet Functions | |||
Re-occuring Inspection Dates | Excel Worksheet Functions |