![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 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 |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
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
__________________
Kind regards, Al Chara |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|