Re: Wondering first caracter for each word in the field
From: Ladi (lavdibakiu_at_hotmail.com)
Date: 03/18/05
- Next message: Rob Oldfield: "Re: Comparing calculated controls on a tab control pages"
- Previous message: John Nurick: "Re: VBA"
- In reply to: Ron Weiner: "Re: Wondering first caracter for each word in the field"
- Next in thread: Ron Weiner: "Re: Wondering first caracter for each word in the field"
- Reply: Ron Weiner: "Re: Wondering first caracter for each word in the field"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Mar 2005 08:43:42 +0100
Sorry Rn for the delay,
What if we need to exclude some word from showing thir first letter through
Initialise function.
Example: From "Ministry of Foreign Affairs" to retreive "MFA" excluding word
"of"?
Thanks,
Ladi
"Ron Weiner" <weinNoSpam1@mindspring.com> wrote in message
news:Onmc$caKFHA.4032@TK2MSFTNGP14.phx.gbl...
> Ladi
>
> I couldn't resist. Here is a function that you can put in a global module
> that can get called from anywhere in your app that will return the first
> initial of every word passed to it.
>
> So for instance: Initialize("Minister of Foreign Offices")
>
> would return MOFO
>
> How about: Initialize("Secretary of Baloney")
> or Initialize("First Undersecretary Concerning Kitchen Ergonomics
> Reorganization")
>
> Just boggles the mind!!
>
> Here is the code.
>
> Public Function Initialize(strIn As String) As String
> Dim strInitals As String, intPos As Integer
>
> strInitals = Left(strIn, 1)
> intPos = InStr(1, strIn, " ")
> Do While intPos > 0
> strInitals = strInitals & Mid(strIn, intPos + 1, 1)
> intPos = InStr(intPos + 1, strIn, " ")
> Loop
> Initialize = Replace(UCase(strInitals), " ", "")
> End Function
>
> Ron W
>
> "Ladi" <lavdibakiu@hotmail.com> wrote in message
> news:u5x4rFaKFHA.604@TK2MSFTNGP10.phx.gbl...
>> Hi all,
>>
>> Is there anyway to retrieve the first character for each word from the
> field
>> formatted as text?
>> Example:
>> On the field there is "Ministry of Foreign Affairs" and we retrieve
> "MOFA".
>>
>> Thanks in advance,
>> Ladi
>>
>>
>
>
- Next message: Rob Oldfield: "Re: Comparing calculated controls on a tab control pages"
- Previous message: John Nurick: "Re: VBA"
- In reply to: Ron Weiner: "Re: Wondering first caracter for each word in the field"
- Next in thread: Ron Weiner: "Re: Wondering first caracter for each word in the field"
- Reply: Ron Weiner: "Re: Wondering first caracter for each word in the field"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|