![]() |
how do i delete spaces in multiple cells thoughout the workbook?
I have a list of 1,400 names, most of which have 2 spaces preceding the name.
i would like to remove all the space. I read to put 2 spaces in the FIND & the following in REPLACE WITH: =--substitute(a1,char(160),"") but that didn't work possibly because it was posted in 2007. |
how do i delete spaces in multiple cells thoughout the workbook?
Find: press space bar twice
Replace with: <leave it blank Replace All "Starr" wrote: I have a list of 1,400 names, most of which have 2 spaces preceding the name. i would like to remove all the space. I read to put 2 spaces in the FIND & the following in REPLACE WITH: =--substitute(a1,char(160),"") but that didn't work possibly because it was posted in 2007. |
how do i delete spaces in multiple cells thoughout the workbook?
Hi
Look at the TRIM() function. Regards, Per On 9 Sep., 04:15, Starr wrote: I have a list of 1,400 names, most of which have 2 spaces preceding the name. *i would like to remove all the space. *I read to put 2 spaces in the FIND & the following in REPLACE WITH: =--substitute(a1,char(160),"") *but that didn't work possibly because it was posted in 2007. |
how do i delete spaces in multiple cells thoughout the workboo
A couple ideas:
Sub Remove_CR_LF() With Selection ..Replace What:=Chr(160), Replacement:=Chr(32), _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False ..Replace What:=Chr(13) & Chr(10), Replacement:=Chr(32), _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False ..Replace What:=Chr(10), Replacement:=Chr(32), _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False End With End Sub Sub tic_killer() Set rr = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants, xlTextValues) For Each r In rr If r.PrefixCharacter = "'" Then r.Value = r.Value End If Next End Sub HTH, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Per Jessen" wrote: Hi Look at the TRIM() function. Regards, Per On 9 Sep., 04:15, Starr wrote: I have a list of 1,400 names, most of which have 2 spaces preceding the name. i would like to remove all the space. I read to put 2 spaces in the FIND & the following in REPLACE WITH: =--substitute(a1,char(160),"") but that didn't work possibly because it was posted in 2007. |
All times are GMT +1. The time now is 11:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com