
VBA has a function named Split which can return an array of sub-strings from a given string. If you are unfamiliar with VBA (Visual Basic for Applications), you can check out our beginner's guide here: How to create a macro in Excel Split Method Each part represents an individual column. In this example, we have rows of data containing data separated by “|” characters. In this guide, we're going to show you how to split text with VBA in Excel. Using VBA, you can make this process even faster. You can then copy the new column without the spaces and do a “Paste Special” into the old column, overwriting the text with the spaces.Text to Columns feature can help you split text strings in Excel. Drag that function down and it will remove all of the spaces: When you’re done with your function, select “OK” and you’ve got your spaces removed. Simple TRIM the text in B1 and it will get rid of the extra spaces: The function you want is in the Text Category (use the dropdown menu) and is called TRIM. Click in cell C1 and then go up to Insert -> Function. If you want to get rid of the extra space, there is a LibreOffice Calc function for that. Once you’re done, hit “OK” and you’ll see your single columns split into two: However, I’m going to leave the extra space and show you one more function that can be useful in more complex situations.

I selected just “Tab” and “Comma” but could also select “Space” to get rid of the extra space. This window gives you several options for splitting the cells, using commas, spaces, semicolons, tabs, other, etc. Select the column that you want to split: Open your spreadsheet with the cells that need to be split, like this: So, here’s a quick tutorial on how this is done. I figure it out every time, but then I forget how I did. I periodically have to take a column of text in LibreOffice calc that has names like this “Lastname, Firstname” and split them into two columns.
