A counting function

  • Thread starter Thread starter Bobby
  • Start date Start date
B

Bobby

Hi! Is there in EXCEL(VBA) a builtin function that count the occurences
in a string. I.E.:
var1 = "Monday Tuesday Wednesday"
Tthe builtin would return the number 3(for 3 words in the string).
Thank's ahead
 
One way

var1 = "Monday Tuesday Wednesday"
ary = Split(var1, " ")
MsgBox UBound(ary) - LBound(ary) + 1

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Thank's Bob! I would love to "remove nothere from email address if
mailing direct" but where do I go for that change?( I did look in my
profile and cannot fing it there)
 
Sorry, are you asking what to do with that code?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
No no Bob! I know and understand your code it's great! I think I miss
interpreted the inscription under your answer(the written comment in
parenthesis) Sorry for the confusion I created.
 
Hi Bob,

I suspect that Bobby has interpreted your:
(remove nothere from email address if mailing direct)

as an instruction to amend *his* details: he did not appreciate that it
represents a means of deciphering your email address.
 
No problems mate, I just didn't want to leave you stranded if there was more
help required.

Regards

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top