concatenate

canablitz

New Member
Joined
Mar 17, 2002
Messages
19
is there any way to concatenate the first letter of 5 or so words in the same cell, in order to produce a code. e.g if i had in cell A1 "the mark tom and travis show" i would want the formula to produce "tmtats"

Please help me, as this is a vital part to my project

BoB
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
If you don't mind using VBA, then try the following:

Sub FirstLettersOfString()
Dim FirstLetters(100)
Dim counter As Integer
Dim YourString As String

FirstLetters(0) = Mid(ActiveCell, 1, 1)
CellLength = Len(ActiveCell)

For i = 1 To CellLength
If Mid(ActiveCell, i, 1) = " " Then
counter = counter + 1
FirstLetters(counter) = Mid(ActiveCell, i + 1, 1)
End If
Next
For h = 0 To counter
YourString = YourString & FirstLetters(h)
Next

MsgBox YourString
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,326
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top