d1ch0t0my
d1ch0t0my

Reputation: 443

Excel function returns #Value

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.

  1. As a test I have 1 entry in my sheet "MikeJones" in cell A1.
  2. in cell B1 I have the formula "=SplitCaps(A1)"

..but the value is returned as #VALUE!. What idiotic thing am I missing here? Thank you!

Upvotes: 0

Views: 99

Answers (1)

teylyn
teylyn

Reputation: 35915

The inferior Excel for Mac is years behind Excel for Windows and does not support vbscript.regexp

See here

Upvotes: 1

Related Questions