Try this function.
Copy the Excel VBA code
Select the workbook in which you want to store the Excel VBA code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
Choose Insert | Module
Where the cursor is flashing, choose Edit | Paste
Go back to your excel file and enter this in B1 (considering that A1 has the string) =splitcaps(A1)![]()
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
Bookmarks