Showing posts with label vba. Show all posts
Showing posts with label vba. Show all posts

Thursday, March 11, 2010

Regular Expressions in Excel

Once I learned a bit about regular expressions in Actionscript 2, I wanted to use them in Microsoft Excel.

It turns out that there is a VBA extension for Regular Expressions and a installable set of custom functions for Excel that includes regular expressions. To make it work, here is what I did:
  1. In Excel, hit alt-F11 to bring up the code screen.
  2. Choose Tools | References and check Microsoft VBScript Regular Expressions 5.5
  3. Close Excel.
  4. Download and install Morefunc 5 from download.cnet.com.
  5. Open Excel and start writing functions like "=REGEX.SUBSTITUTE(V2, " .......$| ....... |^....... |^......$|^.......$"," ???????? ")"


To learn more, check out the Morefunc documentation, sites like this, or sites that I referred to in my previous post. You can also write your own functions like lispy does.

Open Question: What do Excel for Mac users do?

Pretty soon you will be ordering this cup: