Position of a character in a string

A

Alan T

I have string, eg.
Alan
Alan.1
Alan.11

I want to find the position of the '.' in the string then retrieve the left
and right side of full stop.
 
G

Gary''s Student

Sub Alan_T()
s = "Alan.11"
MsgBox (InStr(s, "."))
lefthalf = Split(s, ".")(0)
MsgBox (lefthalf)
righthalf = Split(s, ".")(1)
MsgBox (righthalf)
End Sub
 

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