Split Uppercase words in Excel

前端 未结 6 1493
花落未央
花落未央 2020-12-15 19:48

I would like to split all words in my cell by Uppercase, an example:

Original values:

MikeJones
RinaJonesJunior
MichealSamuelsLurth

6条回答
  •  不思量自难忘°
    2020-12-15 19:57

    Sub caps_small()
    
    strIn = InputBox("Enter a string:")
    
    For i = 1 To Len(strIn)
    
        If Mid(strIn, i, 1) Like "[A-Z]" Then
            cap = Mid(strIn, i, 1)
            capstr = capstr & cap
    
        ElseIf Mid(strIn, i, 1) Like "[a-z]" Then
            sml = Mid(strIn, i, 1)
            smlstr = smlstr & sml
        End If
    Next
    
    MsgBox capstr
    
    MsgBox smlstr
    
    
    End Sub
    

提交回复
热议问题