I have some information provided to me in cells and for some reason they provide names with like 9 or 10 spaces afterwards. How can I select that column and remove those spaces?
If you have no spaces in the cells that you wish to keep (eg between fore and surname) then you could do a Find/Replace on the entire column:
1. Select column
2. Use Ctrl+h to open up Find/Replace dialog
3. In Find box type a space, leave Replace box blank
4. Under options, make sure "Match entire cell contents" is unchecked
5. Hit Replace All
An alternative formula approach might be in adjacent cells to use TRIM:
=TRIM(A1)
and copy down. You could then do a copy/pastespecial>values over your originals
Last alternative I will mention is to select the column, open up the VBE with Alt+F11 and open up the Immediate Window with Ctrl+g and then type (or copy) in the following and place all on one line and press Enter at the end of the line:
Code:
For Each c In Selection:c.Value = Application.Trim(c.Value):Next
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.