In this post we learn to separate words and
numbers within cells in Excel using VBA macros. The macro splits the value in a
cell into parts separated by a space (parts can be letters, words, numbers,
etc). We can easily adapt the macro to separate the value by other character (a
comma, a semi-colon, etc). In this particular example, we will get the keyword
in that cell in one column, a number (if any) in another column, and a date (if
any) in a third column. The keyword can
be based on a reference value or list of values, but in this case, we will just
get the longest word in the sentence, assuming that’s the keyword in that
sentence. If there is more than one number (or more than one date), the macro
gets the last one. That can be easily changed as needed to get a number or date
in a particular position.