Reputation: 443
I am using Excel and trying to use VBA to split some text that I have. I followed the solution from this post however all the cell returns is #VALUE!. I'm using Office 2016 OSX.
The function I have added is as follows:
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
I have made sure the module is named differently to the function.
..but the value is returned as #VALUE!. What idiotic thing am I missing here? Thank you!
Upvotes: 0
Views: 99