Back to Browse

Separate Words and Numbers Excel VBA Macro

5.4K views
Oct 30, 2022
6:52

Excel macro/VBA code available in this post: https://excelmacroclass.blogspot.com/2022/10/separate-words-and-numbers-in-cell.html In this video we see how 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 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 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. You can find many other macro examples and Excel VBA learning materials (including the Excel VBA Guide for Beginners) in the blog under the link: https://excelmacroclass.blogspot.com And yet, if you want more, you can find various Excel applications of different nature in the other blogs of the Excel Macro Mania saga: Excel Macro Fun (https://excelmacrofun.blogspot.com/) Excel Macro Business (https://excelmacrobusiness.blogspot.com/) Excel Macro Sports (https://excelmacrosports.blogspot.com/)

Download

0 formats

No download links available.

Separate Words and Numbers Excel VBA Macro | NatokHD