ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Spaces in Data (https://www.excelbanter.com/new-users-excel/37241-spaces-data.html)

Rhall

Spaces in Data
 

Hi,
I am trying to do a mail merge and the excel data that I am using has a
bunch of spaces in the field that shows the city. So when I list the
City St and Zip the state is about 7 spaces after the city.
123 Main Street


Thanks
RRH


--
Rhall
------------------------------------------------------------------------
Rhall's Profile: http://www.excelforum.com/member.php...o&userid=25630
View this thread: http://www.excelforum.com/showthread...hreadid=390437


KL

Hi,

I think, you might need to clean your database. If the "spaces" are real
spaces (and not other non-printable characters usually resulting from
copy/pasting html sources to Excel) you could create a temporary column and
assuming that cities are in column [A] you could write the following formula
in cell [B1] and copy it down:

=TRIM(A1)

After that, select the column [b] press Ctrl+C (to copy), select the column
[A] go to menu EditPaste Special, choose the option 'Values' and press
'OK'. Now you can erase the column [b].

If the function TRIM doesn't remove the "spaces", then try to use the
formula =CLEAN(A1) instead. This function removes all non-printable
characters from string.

And, of course, you could use both functions together, just in case there is
a combination of spaces and other non-printable characters, like this:
=TRIM(CLEAN(A1))

Regards,
KL


"Rhall" wrote in
message ...

Hi,
I am trying to do a mail merge and the excel data that I am using has a
bunch of spaces in the field that shows the city. So when I list the
City St and Zip the state is about 7 spaces after the city.
123 Main Street


Thanks
RRH


--
Rhall
------------------------------------------------------------------------
Rhall's Profile:
http://www.excelforum.com/member.php...o&userid=25630
View this thread: http://www.excelforum.com/showthread...hreadid=390437





All times are GMT +1. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com