【发布时间】:2017-09-06 20:55:11
【问题描述】:
在 Windows 上,我使用以下函数从 VLOOKUP 公式中提取 lookup_value。但是,我最近切换到了macOS,现在功能不兼容了。
Mac 上 Excel 中的 VBA 不支持正则表达式。有没有我可以使用的替代功能,还是我不走运?
Function extractFirstInt(strValue As String) As Integer
Dim regex As New regexp
regex.Pattern = "(\d+)"
extractFirstInt = regex.Execute(strValue)(0).SubMatches(0)
End Function
【问题讨论】: