ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programming to delet padded spaces (https://www.excelbanter.com/excel-programming/332547-programming-delet-padded-spaces.html)

alitch

Programming to delet padded spaces
 

I have a list of names copied from another program. This field in th
other program is padded to 30 spaces. When you copy and past it int
excel the full field is transfered, including the spaces on the end o
the name that are blank. I'd like to write a function that would ge
rid of the extra spaces for aesthetics. Does anyone have an
suggestions

--
alitc
-----------------------------------------------------------------------
alitch's Profile: http://www.excelforum.com/member.php...fo&userid=2453
View this thread: http://www.excelforum.com/showthread.php?threadid=38127


Ron de Bruin

Programming to delet padded spaces
 
Hi

See this page
http://www.mvps.org/dmcritchie/excel/join.htm#trimall

Look here for a formula way
http://www.rondebruin.nl/clean.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"alitch" wrote in message
...

I have a list of names copied from another program. This field in the
other program is padded to 30 spaces. When you copy and past it into
excel the full field is transfered, including the spaces on the end of
the name that are blank. I'd like to write a function that would get
rid of the extra spaces for aesthetics. Does anyone have any
suggestions?


--
alitch
------------------------------------------------------------------------
alitch's Profile: http://www.excelforum.com/member.php...o&userid=24535
View this thread: http://www.excelforum.com/showthread...hreadid=381270




Tom Ogilvy

Programming to delet padded spaces
 
for each cell in selection
cell.Value = Application.Trim(cell.Value)
Next

--
Regards,
Tom Ogilvy


"alitch" wrote in
message ...

I have a list of names copied from another program. This field in the
other program is padded to 30 spaces. When you copy and past it into
excel the full field is transfered, including the spaces on the end of
the name that are blank. I'd like to write a function that would get
rid of the extra spaces for aesthetics. Does anyone have any
suggestions?


--
alitch
------------------------------------------------------------------------
alitch's Profile:

http://www.excelforum.com/member.php...o&userid=24535
View this thread: http://www.excelforum.com/showthread...hreadid=381270




Gary's Student

Programming to delet padded spaces
 
The TRIM function is available in both the worksheet and VBA. It trims both
leading and trailing spaces.
--
Gary's Student


"alitch" wrote:


I have a list of names copied from another program. This field in the
other program is padded to 30 spaces. When you copy and past it into
excel the full field is transfered, including the spaces on the end of
the name that are blank. I'd like to write a function that would get
rid of the extra spaces for aesthetics. Does anyone have any
suggestions?


--
alitch
------------------------------------------------------------------------
alitch's Profile: http://www.excelforum.com/member.php...o&userid=24535
View this thread: http://www.excelforum.com/showthread...hreadid=381270



alitch[_2_]

Programming to delet padded spaces
 

Excellent

Thanks Tom.....

alitch


--
alitch
------------------------------------------------------------------------
alitch's Profile: http://www.excelforum.com/member.php...o&userid=24535
View this thread: http://www.excelforum.com/showthread...hreadid=381270



All times are GMT +1. The time now is 07:10 PM.

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