Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old May 27th 08, 08:44 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: May 2008
Posts: 56
Default Fisrt letter of every word

Is there any way I can concatenate the first letters of every word in a phrase?
eg management of ancient wood pasture
Answer I am after in one cell "moawp"
The lenhgth of the phrases would be variable, sya up to 15 words.
I would value any help.

Kind Regards
Graham

  #2   Report Post  
Old May 27th 08, 09:10 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2007
Posts: 11,501
Default Fisrt letter of every word

Graham,

I copied this from something written (I think) by Ron Rosenfield but if I've
credited the wrong person then apologies to the original author.

Put this UDF in a general module

Function Firsts(str As String) As String
part = Split(Trim(str))
For x = 0 To UBound(part)
Firsts = Firsts & Left(part(x), 1)
Next
End Function


Call with =Firsts(A1)
where A1 is the string you want the first letters of.

Mike

"Graham H" wrote:

Is there any way I can concatenate the first letters of every word in a phrase?
eg management of ancient wood pasture
Answer I am after in one cell "moawp"
The lenhgth of the phrases would be variable, sya up to 15 words.
I would value any help.

Kind Regards
Graham

  #3   Report Post  
Old May 27th 08, 09:19 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: May 2008
Posts: 56
Default Fisrt letter of every word

Mike,
You are a star! Many thanks for that and for replying so quickly.

Graham

Mike H wrote:
Graham,

I copied this from something written (I think) by Ron Rosenfield but if I've
credited the wrong person then apologies to the original author.

Put this UDF in a general module

Function Firsts(str As String) As String
part = Split(Trim(str))
For x = 0 To UBound(part)
Firsts = Firsts & Left(part(x), 1)
Next
End Function


Call with =Firsts(A1)
where A1 is the string you want the first letters of.

Mike

"Graham H" wrote:

Is there any way I can concatenate the first letters of every word in a phrase?
eg management of ancient wood pasture
Answer I am after in one cell "moawp"
The lenhgth of the phrases would be variable, sya up to 15 words.
I would value any help.

Kind Regards
Graham

  #4   Report Post  
Old May 27th 08, 09:25 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2007
Posts: 11,501
Default Fisrt letter of every word

Your welcome, I merely reposted someone else's work

"Graham H" wrote:

Mike,
You are a star! Many thanks for that and for replying so quickly.

Graham

Mike H wrote:
Graham,

I copied this from something written (I think) by Ron Rosenfield but if I've
credited the wrong person then apologies to the original author.

Put this UDF in a general module

Function Firsts(str As String) As String
part = Split(Trim(str))
For x = 0 To UBound(part)
Firsts = Firsts & Left(part(x), 1)
Next
End Function


Call with =Firsts(A1)
where A1 is the string you want the first letters of.

Mike

"Graham H" wrote:

Is there any way I can concatenate the first letters of every word in a phrase?
eg management of ancient wood pasture
Answer I am after in one cell "moawp"
The lenhgth of the phrases would be variable, sya up to 15 words.
I would value any help.

Kind Regards
Graham


  #5   Report Post  
Old May 27th 08, 10:15 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: May 2008
Posts: 1
Default Fisrt letter of every word

I see you already have an answer, but I spent the time working this method
up, so I thought I would post it anyway (mainly for the archives)...

Function FirstLetters(ByVal Str As String) As String
Dim X As Long
Str = " " & Str
For X = Len(Str) To 2 Step -1
If Mid(Str, X - 1, 1) < " " Then Mid(Str, X, 1) = " "
Next
FirstLetters = Replace(Str, " ", "")
End Function

Rick


"Graham H" wrote in message
...
Is there any way I can concatenate the first letters of every word in a
phrase?
eg management of ancient wood pasture
Answer I am after in one cell "moawp"
The lenhgth of the phrases would be variable, sya up to 15 words.
I would value any help.

Kind Regards
Graham




  #6   Report Post  
Old May 27th 08, 11:53 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: May 2008
Posts: 56
Default Fisrt letter of every word

Thanks for that Rick, your efforts are much appreciated.

Graham

Rick Rothstein (MVP - VB) wrote:
I see you already have an answer, but I spent the time working this
method up, so I thought I would post it anyway (mainly for the archives)...

Function FirstLetters(ByVal Str As String) As String
Dim X As Long
Str = " " & Str
For X = Len(Str) To 2 Step -1
If Mid(Str, X - 1, 1) < " " Then Mid(Str, X, 1) = " "
Next
FirstLetters = Replace(Str, " ", "")
End Function

Rick


"Graham H" wrote in message
...
Is there any way I can concatenate the first letters of every word in
a phrase?
eg management of ancient wood pasture
Answer I am after in one cell "moawp"
The lenhgth of the phrases would be variable, sya up to 15 words.
I would value any help.

Kind Regards
Graham




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
display one letter of a word in a cell r_chaud Excel Worksheet Functions 2 December 4th 07 09:39 PM
Insert letter/no among word ShamsulZ Excel Discussion (Misc queries) 2 October 5th 06 10:39 AM
Default Capital letter for 1st letter of a word Jeff Excel Discussion (Misc queries) 6 July 10th 06 08:36 AM
CAPITALIZONG FIRST LETTER OF EACH WORD IN A TITLE rosygucci Excel Worksheet Functions 13 December 31st 05 04:54 AM
How do I get the first letter of a word in excel Shadowofthedarkgod Excel Discussion (Misc queries) 8 May 31st 05 02:56 AM


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

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017