I have a spreadsheet with one column, Column “M,” that has rows containing alpha numeric values like the following: 103.14 Jose Dolorez Chavez. I am not sure if there is code out there that can loop through each row of cells, cut the numerical values and paste them into an adjacent column. So At the end, I would have:
one column: 103.14 another column: Jose Dolores Chavez
Could someone help me. I’m not sure where to start. The code would need to loop through all 500 rows in column “M,” find/cut the values, and paste them into column “N.”
Any advice would be greatly appreciated and thank you in advance.
Here’s a VBA function you can use. It uses the Val function, which returns the numeric part at the beginning of a string. Just put it in a regular code module in your workbook:
Then in column O put this formula (assumning your data starts in row 2):
And if column N put this formula:
… and copy down.
This leaves you with the original string and two new columns. If you want you can copy and paste over the original.
EDIT: you can use this Excel formula in column O instead of the VBA function:
It’s an array formula and must be entered with
Ctrl-Shft-Enter