Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Counting blanks in a string

In VBA, I know there is a simple way of counting blanks in a string, but
I can't remember it. Anyone know how to do this?

thanks
xnman

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Counting blanks in a string

Hi
one way:
len(your_str)-len(replace(your_str," ",""))

--
Regards
Frank Kabel
Frankfurt, Germany
"xnman" schrieb im Newsbeitrag
...
In VBA, I know there is a simple way of counting blanks in a string,

but
I can't remember it. Anyone know how to do this?

thanks
xnman


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Counting blanks in a string

Len(MyString)-Len(WorksheetFunction.Substitute(MyString," ",""))

--

Vasant



"xnman" wrote in message
...
In VBA, I know there is a simple way of counting blanks in a string, but
I can't remember it. Anyone know how to do this?

thanks
xnman



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
Counting Blanks JPDS Excel Discussion (Misc queries) 6 January 27th 10 02:21 PM
counting the number of instances of a string within another string Keith R Excel Worksheet Functions 3 March 5th 07 06:54 PM
Counting blanks, either 1, 2 or 3 Steve Excel Worksheet Functions 5 January 14th 06 02:18 AM
Counting Blanks T De Villiers Excel Worksheet Functions 2 August 23rd 05 02:34 PM
remove blanks from a string of chars within a cell? rayhollidge Excel Discussion (Misc queries) 3 January 8th 05 02:43 AM


All times are GMT +1. The time now is 06:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"