如何开发包含正则表达式的Excel宏,以便它可以在Windows和Mac中运行 [英] How to develop an Excel Macro that contains regular expressions so it will work in Windows and Mac
问题描述
我已经开发了一个使用 VBScript.RegExp
的Excel 2010 VBA宏。我的一个用户显然是使用支持VBA的Excel Mac 2011,但没有 VBScript.RegExp
。
I have developed an Excel 2010 VBA Macro that makes use of VBScript.RegExp
. One of my users is apparently using Excel Mac 2011, which supports VBA, but no VBScript.RegExp
.
我已经看到几个帖子,提到可以使用可以由VBA宏调用的 AppleScript
创建您自己的RegEx函数。但是,似乎必须是Mac版本的Excel文件和Windows版本。这是不太理想的。
I have seen several posts that mention it is possible to create your own RegEx functions using AppleScript
that could be called by the VBA Macro. However, it seems as though there would have to be a Mac version of the Excel file and a Windows version. This is less than ideal.
是否有另一种方式在VBA中实现与Windows和Mac兼容的正则表达式?
Is there another way to implement regular expressions in VBA that would be compatible with both Windows and Mac?
推荐答案
遗憾的是还没有找到解决方案 - 目前的解决方法是简单地用一系列替换
调用(或其他必需的操作)。
Unfortunately no solution for this has yet been found — the current workaround is to simply replace regular expressions with a series of Replace
calls (or other required operation).
这篇关于如何开发包含正则表达式的Excel宏,以便它可以在Windows和Mac中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!