Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Extract Uppercase Letters

Accidentally posted to Excel General Questions earlier.
Using VBA how would I have the username like Joseph T. Smith be JTS in a
cell? The name could be any length, and if there is not a middle initial such
as Pete Loveless it would be PL.
Thanks for any and all advice and examples.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extract Uppercase Letters

You could pass your user name into this function and it will return the
upper case letters that you want...

Function GetUpperCaseLetters(Text As String) As String
Dim X As Long
For X = 1 To Len(Text)
If Mid$(Text, X, 1) Like "[A-Z]" Then
GetUpperCaseLetters = GetUpperCaseLetters & Mid$(Text, X, 1)
End If
Next
End Function

Rick


"jnf40" wrote in message
...
Accidentally posted to Excel General Questions earlier.
Using VBA how would I have the username like Joseph T. Smith be JTS in a
cell? The name could be any length, and if there is not a middle initial
such
as Pete Loveless it would be PL.
Thanks for any and all advice and examples.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Extract Uppercase Letters

Thanks works great

"Rick Rothstein (MVP - VB)" wrote:

You could pass your user name into this function and it will return the
upper case letters that you want...

Function GetUpperCaseLetters(Text As String) As String
Dim X As Long
For X = 1 To Len(Text)
If Mid$(Text, X, 1) Like "[A-Z]" Then
GetUpperCaseLetters = GetUpperCaseLetters & Mid$(Text, X, 1)
End If
Next
End Function

Rick


"jnf40" wrote in message
...
Accidentally posted to Excel General Questions earlier.
Using VBA how would I have the username like Joseph T. Smith be JTS in a
cell? The name could be any length, and if there is not a middle initial
such
as Pete Loveless it would be PL.
Thanks for any and all advice and examples.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Extract Uppercase Letters

Rick did you ever get a chance to look at the rest of that code from the
"Check Characters and Change as Needed" post from 4/8/08?

"Rick Rothstein (MVP - VB)" wrote:

You could pass your user name into this function and it will return the
upper case letters that you want...

Function GetUpperCaseLetters(Text As String) As String
Dim X As Long
For X = 1 To Len(Text)
If Mid$(Text, X, 1) Like "[A-Z]" Then
GetUpperCaseLetters = GetUpperCaseLetters & Mid$(Text, X, 1)
End If
Next
End Function

Rick


"jnf40" wrote in message
...
Accidentally posted to Excel General Questions earlier.
Using VBA how would I have the username like Joseph T. Smith be JTS in a
cell? The name could be any length, and if there is not a middle initial
such
as Pete Loveless it would be PL.
Thanks for any and all advice and examples.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Extract Uppercase Letters

Hmmm, I tried it and it "BOMD" on "Bob O. McDuff"

"Rick Rothstein (MVP - VB)" wrote:

You could pass your user name into this function and it will return the
upper case letters that you want...

Function GetUpperCaseLetters(Text As String) As String
Dim X As Long
For X = 1 To Len(Text)
If Mid$(Text, X, 1) Like "[A-Z]" Then
GetUpperCaseLetters = GetUpperCaseLetters & Mid$(Text, X, 1)
End If
Next
End Function

Rick


"jnf40" wrote in message
...
Accidentally posted to Excel General Questions earlier.
Using VBA how would I have the username like Joseph T. Smith be JTS in a
cell? The name could be any length, and if there is not a middle initial
such
as Pete Loveless it would be PL.
Thanks for any and all advice and examples.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extract Uppercase Letters

While I'm sure there are lot's of other exception (and I'm not completely
sure BOMD is not what the OP wants), you can handle the McDuff problem this
way...

Function GetUpperCaseLetters(Text As String) As String
Dim X As Long
For X = 1 To Len(Text)
If Mid$(StrConv(Text, vbProperCase), X, 1) Like "[A-Z]" Then
GetUpperCaseLetters = GetUpperCaseLetters & Mid$(Text, X, 1)
End If
Next
End Function

Rick


"Charlie" wrote in message
...
Hmmm, I tried it and it "BOMD" on "Bob O. McDuff"

"Rick Rothstein (MVP - VB)" wrote:

You could pass your user name into this function and it will return the
upper case letters that you want...

Function GetUpperCaseLetters(Text As String) As String
Dim X As Long
For X = 1 To Len(Text)
If Mid$(Text, X, 1) Like "[A-Z]" Then
GetUpperCaseLetters = GetUpperCaseLetters & Mid$(Text, X, 1)
End If
Next
End Function

Rick


"jnf40" wrote in message
...
Accidentally posted to Excel General Questions earlier.
Using VBA how would I have the username like Joseph T. Smith be JTS in
a
cell? The name could be any length, and if there is not a middle
initial
such
as Pete Loveless it would be PL.
Thanks for any and all advice and examples.





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Extract Uppercase Letters

Looks fine to me, what's wrong if that's what you are suggesting

Regards,
Peter T


"Charlie" wrote in message
...
Hmmm, I tried it and it "BOMD" on "Bob O. McDuff"

"Rick Rothstein (MVP - VB)" wrote:

You could pass your user name into this function and it will return the
upper case letters that you want...

Function GetUpperCaseLetters(Text As String) As String
Dim X As Long
For X = 1 To Len(Text)
If Mid$(Text, X, 1) Like "[A-Z]" Then
GetUpperCaseLetters = GetUpperCaseLetters & Mid$(Text, X, 1)
End If
Next
End Function

Rick


"jnf40" wrote in message
...
Accidentally posted to Excel General Questions earlier.
Using VBA how would I have the username like Joseph T. Smith be JTS in

a
cell? The name could be any length, and if there is not a middle

initial
such
as Pete Loveless it would be PL.
Thanks for any and all advice and examples.






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
Counting only uppercase letters with wildcard in column/row TJA New Users to Excel 6 September 20th 07 11:52 PM
In Excel, can you change uppercase letters to lowercase mdh6245 New Users to Excel 2 September 4th 07 10:06 PM
excel: count uppercase letters in a cell harry bachrach Excel Worksheet Functions 13 July 13th 07 03:58 PM
Why do all my cells automatically turn into uppercase letters? Tomcat Excel Discussion (Misc queries) 2 October 3rd 05 12:09 AM
CHANGE WHOLE EXCEL worksheet TO UPPERCASE LETTERS? mineralgirl Excel Discussion (Misc queries) 4 September 3rd 05 01:29 AM


All times are GMT +1. The time now is 10:43 AM.

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

About Us

"It's about Microsoft Excel"