erasing empty spaces

D

dstiefe

I have a colum of data that has spaced before the text...the number of spaces
varies per cell..

how do i eliminate the spaces within each cell?

Thank you
 
P

Peter T

With Range("A1:A12")
.Offset(, 1).Value = Application.Trim(.Value)
End With

Regards,
Peter T
 
D

Dave Peterson

If you want to get rid of all the space characters, you could:

Select the range to fix
edit|replace
what: (space character)
with: (leave blank)
replace all

don't do this if the cells contain other spaces that need to be kept.
 
B

B Lynn B

use TRIM function. e.g. if your data is in column A, you could put formula
in b1:
=TRIM(A1) and copy down the length of your data. removes both leading and
trailing spaces.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top