last char of a string

  • Thread starter Thread starter Buddy Lee
  • Start date Start date
B

Buddy Lee

how can I get the last char of a string?
e.g. "abcdefg" -> last char is "g"
does excel know something like "txt[ Len(txt) ]"???
 
thank you ;)

--

icq 25372592
Mark H. Shin said:
myString = "abcdefg"

lastChar = Right(myString,1)

Buddy Lee said:
how can I get the last char of a string?
e.g. "abcdefg" -> last char is "g"
does excel know something like "txt[ Len(txt) ]"???
 
Hi Buddy,

IIRC, the Right() function was introduced to VBA in the Office 2000 version.
So if you need to support earlier versions, you could use a combination of
the Mid() & Len() functions.

Regards,
Vic Eldridge
 
Right has been there a long time before xl2k.

I bet you were thinking of instrrev.



Vic said:
Hi Buddy,

IIRC, the Right() function was introduced to VBA in the Office 2000 version.
So if you need to support earlier versions, you could use a combination of
the Mid() & Len() functions.

Regards,
Vic Eldridge

Buddy Lee said:
how can I get the last char of a string?
e.g. "abcdefg" -> last char is "g"
does excel know something like "txt[ Len(txt) ]"???
 
I bet you were thinking of instrrev.

I think you've won that bet Dave.
Thanks for the correction.

Regards,
Vic Eldridge




Dave Peterson said:
Right has been there a long time before xl2k.

I bet you were thinking of instrrev.



Vic said:
Hi Buddy,

IIRC, the Right() function was introduced to VBA in the Office 2000 version.
So if you need to support earlier versions, you could use a combination of
the Mid() & Len() functions.

Regards,
Vic Eldridge

Buddy Lee said:
how can I get the last char of a string?
e.g. "abcdefg" -> last char is "g"
does excel know something like "txt[ Len(txt) ]"???
 
Back
Top