Split Uppercase words in Excel

excel, excel-formula, regex, vba

Solution

Having acknowledged Excellll's remarkable formula, the most efficient code solution would be `RegExp` based. This avoids long loops.

Function SplitCaps(strIn As String) As String
Dim objRegex As Object
Set objRegex = CreateObject("vbscript.regexp")
With objRegex
    .Global = True
    .Pattern = "([a-z])([A-Z])"
    SplitCaps = .Replace(strIn, "$1 $2")
End With
End Function

Problem

I would like to split all words in my cell by Uppercase, an example: Original values: ``` MikeJones RinaJonesJunior MichealSamuelsLurth ``` Expected output: ``` Mike Jones Rina Jones Junior Micheal Samuels Lurth ``` Can this be done without using VBA?

Original source