+ Reply to Thread
Results 1 to 4 of 4

Script to remove spaces at end of text

  1. #1
    Registered User
    Join Date
    05-06-2005
    Posts
    20

    Script to remove spaces at end of text

    Is there any script you can generate to remove spaces from the end of some known text, that appears randomly in a cell(s) of a column?

    Say "TEXT " to "TEXT"

    Thanks for your help

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Use the TRIM function.


    - Mangesh

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Sonic,

    MyText = RTrim("TEXT ")

    MyText will equal "Text"

    There are 3 Trim functions, all of which remove spaces.

    Trim(String) removes both leading and trailing spaces
    LTrim(String) removes Leading spaces (Left Side)
    RTrim(String) remoces Trailing spaces (Right Side)

    Sincerely,
    Leith Ross

  4. #4
    Registered User
    Join Date
    05-06-2005
    Posts
    20
    Thanks very much for your replies, mangesh_yadav and Leith Ross.

    That worked the trick!
    I Realised when you suggested "Trim", I have used this function before.
    Thanks for your help

+ 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