ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Extracting First Letter (https://www.excelbanter.com/new-users-excel/125453-extracting-first-letter.html)

crackle

Extracting First Letter
 
Can anyone help, i'm trying to extract the first letter of each word within
any given phrase. I'm using excel 2003
--
Thanks

Max

Extracting First Letter
 
Perhaps this might suffice

With text running in A1 down
In B1: =LEFT(TRIM(A1),1)
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"crackle" wrote:
Can anyone help, i'm trying to extract the first letter of each word within
any given phrase. I'm using excel 2003
--
Thanks


crackle

Extracting First Letter
 
Sorry Max, let me be more specific, eg. Lets say I have the phrase "The quick
brown fox jumped over the moon" located in A1, now I want extract the first
letter of each word within that phrase, or any phrase I might put in A1.

What I am using it for is first letter memory techniques of any given phrase.
--
Thanks


"Max" wrote:

Perhaps this might suffice

With text running in A1 down
In B1: =LEFT(TRIM(A1),1)
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"crackle" wrote:
Can anyone help, i'm trying to extract the first letter of each word within
any given phrase. I'm using excel 2003
--
Thanks


Max

Extracting First Letter
 
One way is to use this fine UDF (FrstLtrs) by Ron Rosenfeld

Here's the extract from Ron's reply to get you going ..

" .. Hi, I want to extract the 1st letter of each word in a string.
So for eg, in the string "my name is fred" I want to extract "mnif"

....

It's easy with a User Defined Function.
<alt<F11 opens the VB Editor.

Ensure your project is highlighted in the project explorer window, then
Insert/Module and paste the code below into the window.

To use this UDF, enter a formula of the type
=FrstLtrs(A1) where your string is in A1.

'===========
Function FrstLtrs(str As String) As String
Dim temp
Dim i As Long

temp = Split(Trim(str))

For i = 0 To UBound(temp)
FrstLtrs = FrstLtrs & Left(temp(i), 1)
Next i

End Function
'============
--ron

...."

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"crackle" wrote:
Sorry Max, let me be more specific, eg. Lets say I have the phrase "The quick
brown fox jumped over the moon" located in A1, now I want extract the first
letter of each word within that phrase, or any phrase I might put in A1.

What I am using it for is first letter memory techniques of any given phrase.
--
Thanks


crackle

Extracting First Letter
 
Thanks Mate

works a treat. Don't know how it does it but is sure has saved me helluva
heaps of time.

--
Thanks


"Max" wrote:

One way is to use this fine UDF (FrstLtrs) by Ron Rosenfeld

Here's the extract from Ron's reply to get you going ..

" .. Hi, I want to extract the 1st letter of each word in a string.
So for eg, in the string "my name is fred" I want to extract "mnif"

...

It's easy with a User Defined Function.
<alt<F11 opens the VB Editor.

Ensure your project is highlighted in the project explorer window, then
Insert/Module and paste the code below into the window.

To use this UDF, enter a formula of the type
=FrstLtrs(A1) where your string is in A1.

'===========
Function FrstLtrs(str As String) As String
Dim temp
Dim i As Long

temp = Split(Trim(str))

For i = 0 To UBound(temp)
FrstLtrs = FrstLtrs & Left(temp(i), 1)
Next i

End Function
'============
--ron

..."

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"crackle" wrote:
Sorry Max, let me be more specific, eg. Lets say I have the phrase "The quick
brown fox jumped over the moon" located in A1, now I want extract the first
letter of each word within that phrase, or any phrase I might put in A1.

What I am using it for is first letter memory techniques of any given phrase.
--
Thanks


Max

Extracting First Letter
 
You're welcome. I'm sure Ron would be pleased that his UDF was a great fit
here !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"crackle" wrote:
Thanks Mate

works a treat. Don't know how it does it but is sure has saved me helluva
heaps of time.




All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com