View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jonathan Brown Jonathan Brown is offline
external usenet poster
 
Posts: 47
Default Remove the right most 3 characters from a string

I'm using a loop to build a string of characters but I'm getting extra
characters at the end that I don't want. Is there a function like trimend or
regexp where I can take the string and remove the right most 3 characters?

Here's an example:

arraystring = "someword", "someword2", "someword3", "someword4", "

I'd like it to change my arraystring to show just:

"someword", "someword2", "someword3", "someword4"

This doesn't seem to work for me:
ArrayString = Trim(ArrayString, Right(Len(ArrayString) - 3))

I'm getting an error under the right() function.