Skip to main content

Posts

Featured

Excel : On the Fly Regex Filter

You have a column of text. Like a good Excel pro, it's part of a table. You want to have a column right next to this one that shows a Y in each cell for which the cell containing text of interest matches a regex. How? Easy. Say the Y (yes or no) column is Excel column H. It's header is cell H3. And you wish to put your regex in cell H2. You can do it as single quote followed by whatever, or whatever surrounded by double-quotes. The former does look prettier, but you want to stay flexible. The right thing to do is to have the below VBA routine in your PERSONAL.xlsb ( Personal Macro Workbook ) (Get mine ) Then, in the topmost (see video below) cell-to-the-right, just put =IF(PERSONAL.XLSB!RegexMatch(G4, $H$2), "Y", "") And you're done. Having to use the qualified name is ugly, isn't it? :) Copy Public Function RegexMatch(text As String, pattern As String) As Boolean Dim re As Object If Left(pattern, 1) = """" And Ri...

Latest Posts

Getting the Productive Setup on GNOME Wayland

Krystyna Slusarczyk - Where You Can Go to Be a Cleaner Coder

Aria Tedjarati : Where You Can Go to Be a Better Engineer

Coding without chatGPT - You Know What I Mean

Menu Based Hide/Unhide Columns in an Excel Table

Can You Speed Up a Video on a Web Page When It Doesn't Offer a Speed Control?

Giving Back - to Sumit Bansal - Trump Excel

Pogue : Microsoft Powertoys and Paint 3D

In the Words of Robert Duvall : Why You Should Become a Power User

Get Started On Your Journey to Product Management Mastery