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.
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.
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
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)
Bookmarks