Results 1 to 3 of 3

Thread: How to Delete last Characters from Text String

  1. #1
    Join Date
    Mar 2009
    Posts
    89

    How to Delete last Characters from Text String

    Hi friends,

    I am having some string in my Cell and i want to delete last space in each text string? I have heared from my friends in Excel we can do it but they don't have any idea how to use it can anyone help me out with this issue.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to Delete last Characters from Text String

    Try to use this code i hope it will wok for you in Excel

    Code:
    Option Explicit 
     
    Function Remove_Right_Side(MySTRING As String) As String 
        Dim IFOUND As Integer 
        Dim I As Integer 
        IFOUND = 0 
        For I = Len(MySTRING) To 1  Step -1 
            If ((Mid(MySTRING, I, 1) = " ") And (IFOUND = 0)) Then IFOUND = I: Exit For 
        Next I 
        If (IFOUND <> 0) Then Remove_Right_Side = Left(MySTRING, IFOUND - 1) 
    End Function

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How to Delete last Characters from Text String

    Try to use this formula in excel hope it works for you.

    With string in A3
    =LEFT(SUBSTITUTE(A3," ","%",LEN(A3)-LEN(SUBSTITUTE(A3," ",))),SEARCH("%",SUBSTITUTE(A3," ","%",LEN(A3)-LEN(SUBSTITUTE(A3," ",))))-1)

Similar Threads

  1. how to remove certain characters from a String in java
    By Baazigar in forum Software Development
    Replies: 3
    Last Post: 13-02-2010, 08:02 PM
  2. Replace text string using batch file
    By jean-paul martell in forum Operating Systems
    Replies: 2
    Last Post: 23-06-2009, 01:18 PM
  3. Regex strip out all non alpha Characters from a String
    By Chhaya in forum Software Development
    Replies: 2
    Last Post: 22-05-2009, 06:51 PM
  4. Counting characters in a text box
    By JamesB in forum Software Development
    Replies: 2
    Last Post: 24-03-2009, 08:20 PM
  5. Reading text string from text file (PHP)
    By Moderate in forum Software Development
    Replies: 3
    Last Post: 16-01-2009, 03:27 PM

Tags for this Thread

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
  •  
Page generated in 1,751,711,105.62184 seconds with 16 queries