VBA code for creating factorial combinations

In certain situations, such as systematically generating computer code for analyzing data, it is necessary to create a combination of a variety of factors. Creating factorial combinations is easy when there are only a few factors and levels, but in more complicated situations the task is tedious and prone to error. This Excel file uses VBA to create full-factor combinations with up to 15 factors, each with up to 100 levels. An optional delimiter (such as ” AND “) can be inserted between each level in the combination.
Continue reading “VBA code for creating factorial combinations”

Regular expression for searching “near” text (i.e., within X words)

The Chrome function for finding text on a webpage (Ctrl-F) is fine, but it doesn’t allow finding one word “near” another one. For example, if the text on the page has many instances of “this” and many instances of “that,” using Ctrl-F to find a spot where it says “this and also that” is tedious.

The Chrome plug-in “Regex Search” allows regular expressions for searching the text on a webpage. Regular expressions are powerful, but they can be a pain to create.

Continue reading “Regular expression for searching “near” text (i.e., within X words)”