AAAAAAA
in need to check if the last caharcter in string is a blank end delete it if exists...
note:
i dont remember if i just oost this question but not found in my old post
![Grin :grin:](./images/smilies/grin.gif)
Code: Select all
Dim MyVar As String
MyVar = " AAA "
MyVar = Trim(MyVar)
Code: Select all
If Right(MyVar, 1) = " " Then
MyVar = Left(MyVar, Len(MyVar) - 1)
End If
great!HansV wrote:If you want to delete ALL leading and trailing spaces, you can use Trim:
MyVar will then be "AAA"Code: Select all
Dim MyVar As String MyVar = " AAA " MyVar = Trim(MyVar)
Otherwise:
Code: Select all
If Right(MyVar, 1) = " " Then MyVar = Left(MyVar, Len(MyVar) - 1) End If