是否可以将VBA用户定义的函数连接到Power Query? PQ可以使用自定义Excel类似的UDF吗? 只想使用VBA的正则表达式
Public Function RegExpTest(str As String, _
Pattern As String, _
Optional IgnoreCase As Boolean = False, _
Optional Multiline As Boolean = False) _
As Boolean
RegExpTest = False
If Not str Like "" And Not Pattern Like "" Then
Dim RegExp As Object
Set RegExp = CreateObject("VBScript.RegExp")
With RegExp
.IgnoreCase = IgnoreCase
.Multiline = Multiline
.Pattern = Pattern
End With
On Error Resume Next
RegExpTest = RegExp.Test(str)
Set RegExp = Nothing
End If
End Function
答案 0 :(得分:1)
不,PQ无法直接与VBA对话,但您可以跨Excel工作表共享数据(即将数据加载到工作表,而不是在工作表上运行VBA)。