In the absence of any other response, I can offer a User Defined Function (UDF)
Option Explicit
Function GetUC(ByVal rRng As Range) As String
'example call: =getuc(A2)
Dim i As Long
Dim soutput As String
Dim wdArr
' separate the "words" in the cell
wdArr = Split(rRng, " ")
' loop through each of the words in the array
For i = LBound(wdArr) To UBound(wdArr)
' check if the array element is ALL upper case
' and the array element is not numeric
If wdArr(i) = UCase(wdArr(i)) _
And Not IsNumeric(wdArr(i)) _
Then
' build an ouput string (uppercase words)
soutput = soutput & wdArr(i) & " "
End If
Next 'i
' remove the trailinng space and return the value
On Error Resume Next
GetUC = Left(soutput, Len(soutput) - 1)
' cater for error condition, eg, no upper case values
If Err.Number <> 0 Then GetUC = ""
On Error GoTo 0
End Function
Sub Test_GetUC()
MsgBox GetUC(Range("A2"))
End Sub
Open the VBE by pressing Alt-F11.
Insert a new (Standard) Module.
Copy and Paste the code above into the new module.
In the spreadsheet, call the function using: =GetUC( ... cell address ...), for example, =GetUC(A2)
Regards, TMS
Bookmarks