Solutions

July 2023 / VBA Excel / Dashboards

Advanced splitting of text substrings with parameterization of columns and dynamic criteria.

Although to separate text substrings we can use some functions built into Excel, such as TEXTSPLIT (highly recommended and powerful) or TEXT TO COLUMNS, these functions depend on a single separator and sometimes it is necessary to apply combined logic that can only be reached by VBA.

This model is a small sample of how to apply VBA’s one-dimensional array and split techniques. The demo is very simple and shows methods that are normally developed within larger projects as intermediate steps inserted into code modules.

The key to the model is to add to the criteria selector combo a structure of fields and separators (commas and spaces) that is consistent with the structure of the source data.