![]() |
What's the formula for alpha code?
I need the formula for alpha code for example the woord First National Bank
code is FNB now what's the code or formula you put in to change that to that. |
What's the formula for alpha code?
What do mean by "alpha code"?
Do want to select first character of each word to make an abbreviation? And would this always be the case? "Tania" wrote: I need the formula for alpha code for example the woord First National Bank code is FNB now what's the code or formula you put in to change that to that. |
What's the formula for alpha code?
Yes i want to select the first character of each word to make an abbreviation?
"Toppers" wrote: What do mean by "alpha code"? Do want to select first character of each word to make an abbreviation? And would this always be the case? "Tania" wrote: I need the formula for alpha code for example the woord First National Bank code is FNB now what's the code or formula you put in to change that to that. |
What's the formula for alpha code?
try this UDF:
Look here for info on Visual Basic Editor: http://www.cpearson.com/excel/vbe.htm Function GetInitials(ByRef intext As Range) As String mytext = intext.Value initials = Left(mytext, 1) ist = 1 Do n = InStr(ist, mytext, " ") If n = 0 Then GetInitials = initials Exit Function End If mytext = Mid(mytext, n + 1, 255) initials = initials + Left(mytext, 1) Loop End Function with data in A!; in B1: =GetInitials(A1) "Tania" wrote: Yes i want to select the first character of each word to make an abbreviation? "Toppers" wrote: What do mean by "alpha code"? Do want to select first character of each word to make an abbreviation? And would this always be the case? "Tania" wrote: I need the formula for alpha code for example the woord First National Bank code is FNB now what's the code or formula you put in to change that to that. |
What's the formula for alpha code?
On Thu, 23 Aug 2007 03:46:19 -0700, Tania
wrote: I need the formula for alpha code for example the woord First National Bank code is FNB now what's the code or formula you put in to change that to that. The following should return the first alpha-numeric character of each word in a string, all capitalized. First enter the UDF below. To do that, <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 that opens. Then use this formula: =UPPER(recode(A1,"(\w).*?(\s|$)","$1")) Substitute your cell_reference for A1. =============================== Option Explicit Function ReCode(str As String, sPtrn As String, sRepl As String) As String Dim re As Object Set re = CreateObject("vbscript.regexp") re.Global = True re.Pattern = sPtrn ReCode = re.Replace(str, sRepl) End Function ================================= --ron |
All times are GMT +1. The time now is 05:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com