Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to use regex substitution with Excel find & replace (in the GUI)?

Using a JavaScript example, I want to do something like this:
"John Smith".replace(/(.*)\s(\.*)/, "$2, $1") // returns "Smith, John"

share|improve this question

2 Answers 2

up vote 1 down vote accepted

There is an add-on at www.codedawn.com that adds regexp functionality to MS Excel's find&replace dialog. That's the answer! Just one note: replacements made by this add-on are NOT UNDOABLE. You will be warned to save your workbook before committing replace.

share|improve this answer
    
Thanks, exactly what I was looking for - though I was surprised its not built-in. Actual link is codedawn.com/excel-add-ins.php. –  studgeek Dec 3 '11 at 18:37

I beleive you can get similar functionality combining Excel's FIND and MID functions - note that if what you're finding (the "\s" in your example) is a wildcard also, your function will probably get very long - but it's possible. See this article for some (fairly simple) examples.

share|improve this answer
    
Thanks, but I was actually looking for it in the GUI, which wasn't clear in my original question so I updated it. –  studgeek Dec 3 '11 at 18:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.