Excel - Extract words in uppercase

December 2016




Issue


I would like to create a formula to extract the word in uppercase in a cell.

Solution


You can try to use this function:

Public Function majuscules(zone) 
Dim sel As Object 
Dim i As Integer 
Application.Volatile 
For Each sel In zone 
    For i = 1 To Len(sel) 
        If Asc(Mid(sel, i, 1)) > 64 And Asc(Mid(sel, i, 1)) < 91 Then 
            majuscules = majuscules & Mid(sel, i, 1) 
        End If 
    Next i 
Next sel 
End Function 

Thanks to gbinforme for this tip.

Related :

This document entitled « Excel - Extract words in uppercase » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.