Split Uppercase words in Excel

前端 未结 6 1496
花落未央
花落未央 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 20:14

    you have to do this with VBA.

    Sub insertspaces()
    Range("A1").Select
    Do
        Row = ActiveCell.Row
        Column = ActiveCell.Column
        vlaue = ActiveCell.Value
        If vlaue = "" Then Exit Do
            Length = Len(vlaue)
            If Length > 1 Then
                For x = Length To 2 Step -1
                par = Mid(vlaue, x, 1)
                cod = Asc(par)
                If (cod > 64 And cod < 91) Or (cod > 191 And cod < 222) Then
                vlaue = Left(vlaue, x - 1) + " " + Mid(vlaue, x)
                End If
            Next
            ActiveCell.Value = vlaue
            End If
        Row = Row + 1
        Cells(Row, Column).Select
    Loop
    End Sub
    

提交回复
热议问题