![]() |
How do you count the number of * in a string?
Hi all,
Could anybody provide the vba code to count the number of * contained in the string of a cell. The string has leading 'spaces' TIA Regards Michale |
How do you count the number of * in a string?
On Jan 14, 1:22*pm, "michael.beckinsale"
wrote: Hi all, Could anybody provide the vba code to count the number of * contained in the string of a cell. The string has leading 'spaces' TIA Regards Michale If the string is in C1 occursnumber = Len(Range("C1")) - Len(Replace(Range("C1"), "*", "")) Regards, Stefi |
How do you count the number of * in a string?
Hi Stef,
Thanks very much, works like a dream. I would never thought of doing that way! Regards Michael |
How do you count the number of * in a string?
You are welcome! Thanks for the feedback!
Clicking the YES button will be appreciated. Stefi €˛michael.beckinsale€¯ ezt Ć*rta: Hi Stef, Thanks very much, works like a dream. I would never thought of doing that way! Regards Michael . |
How do you count the number of * in a string?
Another way to count the asterisks (just so you can see that VB is rich with possibilities) is this...
NumberOfAsterisk = UBound(Split(Range("C1"), "*")) -- Rick (MVP - Excel) "michael.beckinsale" wrote in message ... Hi Stef, Thanks very much, works like a dream. I would never thought of doing that way! Regards Michael |
How do you count the number of * in a string?
On Jan 14, 6:02*pm, "Rick Rothstein"
wrote: Another way to count the asterisks (just so you can see that VB is rich with possibilities) is this... NumberOfAsterisk = UBound(Split(Range("C1"), "*")) -- Rick (MVP - Excel) "michael.beckinsale" wrote in ... Hi Stef, Thanks very much, works like a dream. I would never thought of doing that way! Regards Michael- Hide quoted text - - Show quoted text - That's really tricky! Stefi |
All times are GMT +1. The time now is 10:49 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com