+ Reply to Thread
Results 1 to 5 of 5

Programming to delet padded spaces

  1. #1
    Registered User
    Join Date
    06-22-2005
    Posts
    2

    Programming to delet padded spaces

    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?

  2. #2
    Ron de Bruin
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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
    >




  3. #3
    Tom Ogilvy
    Guest

    Re: Programming to delet padded spaces

    for each cell in selection
    cell.Value = Application.Trim(cell.Value)
    Next

    --
    Regards,
    Tom Ogilvy


    "alitch" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




  4. #4
    Gary's Student
    Guest

    RE: 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
    >
    >


  5. #5
    Registered User
    Join Date
    06-22-2005
    Posts
    2

    Trim Function

    Excellent

    Thanks Tom.....

    alitch

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1