read first character(number) in a word

J

john smith

Hi,

I'd like to read the first character in a word(number actually).

For example:
I have a number 1.1.2, I only want to read the first number which is 1 and
save it in a variable. If it's 3.2.3 then the first character will be 3 and
save it in a variable.

Please help me!

Thank you.
 
J

Jean-Guy Marcil

john smith was telling us:
john smith nous racontait que :
Hi,

I'd like to read the first character in a word(number actually).

For example:
I have a number 1.1.2, I only want to read the first number which is
1 and save it in a variable. If it's 3.2.3 then the first character
will be 3 and save it in a variable.

Dim strTest As String
Dim strFirstChar As String

strTest = "1.2.3.4"
strFirstChar = Left(strTest, 1)


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top