How To Remove Spaces In Excel Column
There are multiple ways to remove spaces in excel.
How to remove spaces in excel column. Press space bar in the find what field and make sure the replace with field is empty. Select the entire column you want to clean. This removes the spaces anywhere from the selected cells.
Select the cells range entire column or row where you want to delete extra spaces. Click insert module to create a new module script copy and paste below code to the script. In the find what field type two spaces.
Choose one or more options. Remove leading and trailing spaces. There we need to put a space and replace that with blank nothing kept.
The cell must be on the same row as the first line of data in the column with the spaces. E2 f2 g2 etc. We will consider the same data used in example 1.
For example if you want to remove spaces from column c and c s first row of data is in row 2 c2 click the second cell in your blank column e g. Press ctrl h and a dialog box appears for find and replace. Press f5 key to run the code then a.
Below in find what box press spacebar and in replace button to leave it a blank and click on replace all. Select the cells containing spaces you will remove press the ctrl h keys to open the find and replace dialog box. In the find and replace dialog and under the replace tab type one space into the find what textbox keep the replace with textbox empty and then click the replace all button.