Deleting spaces

P

Pete C

This is probably not an excel problem and I'm not sure if this is solvable.

I pasted some information into cells but they when I pasted, it included a
typing space at the end of the information, something I don't need.

Is there anyway to get rid of this space?

Thank you,
 
J

John W. Vinson

This is probably not an excel problem and I'm not sure if this is solvable.

I pasted some information into cells but they when I pasted, it included a
typing space at the end of the information, something I don't need.

Is there anyway to get rid of this space?

Thank you,

It may not be an Excl question, but it's certainly not an Access question -
and this newsgroup is for Access. Please repost in an Excel group.
 
R

roccogrand

Pete,

This is a fairly easy operation for Access to perform, especially Access
2007 but it also works in older versions as well.

First, import your worksheet into Access. The wizard works great for this.
If you need to do this operation often then name and save the import process
for future use.

With a new table in Access, create a simple query to retrieve the column(s)
of interest. Next turn the simple query into an Update Query.

Type LTrim([myfieldname]) into the Update to: cell if there
are leading spaces that you want to delete.
Type RTrim([myfieldname]) into the Update to: cell if there
are trailing spaces that you want to delete.

"myfieldname" is the name of the columns in your table.

Run the Update Query. Check that those pesky spaces are gone.

Use the Export to Excel wizard to export the data back into Excel. Or
better yet, abandon Excel and use Access for your analyses. Again if you do
this often, name and save the Export Profile. The export wizard is on the
External Data ribbon.

LDN
 
Top