Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default 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


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
formula to add Alpha? SLP Excel Worksheet Functions 3 June 11th 07 10:12 PM
Using a cell w/Alpha numeric characters in mulplication formula MAJ0116 Excel Worksheet Functions 4 February 10th 07 01:07 AM
convert numbers to alpha code chas Excel Discussion (Misc queries) 1 November 26th 06 12:33 AM
What is the formula to average alpha? Ninibelle Excel Worksheet Functions 3 November 18th 05 04:36 PM
The colums changed from alpha to numeric how do you make it alpha worldmade Excel Discussion (Misc queries) 2 May 26th 05 03:44 PM


All times are GMT +1. The time now is 07:00 PM.

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

About Us

"It's about Microsoft Excel"