Consulting

Results 1 to 2 of 2

Thread: Working with String in VBA

  1. #1

    Working with String in VBA

    Hi, let say I have a string:

    MyString = "D:\dst"

    Now I need to write a small VBA code which will check if there is any "\" in the last place of that string, and if it is there then it will remove that.

    Can somebody help me how to write that?

    Thanks and regards,

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,730
    Location
    [VBA]
    If Right(MyString,1) = "\" then MyString = Left(MyString, Len(MyString)-1)
    [/VBA]



    Paul

Posting Permissions

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