Instr problem


Hi Guys

I always had problem with instr


dim mystring as string
mystring="aa bb"

I want to get the in two separate variables aa and bb
basically anything from the start to the space and
anything from the space to the end

dim variableAA as string
variableAA=instr(????)
variableBB=instr(???)

can you help
Thanks
Gabriel
Gabriel_BrienzaAsked:
Who is Participating?
 
WizOfOzCommented:
variableAA=split(mystring, " ")(0)
variableBB=split(mystring, " ")(1)

try this

0
 
WizOfOzCommented:
Why not use split?
variableAA=split (mystring," ")(0)
variableBB=split (mystring," ")(0)
0
 
WizOfOzCommented:
ops, xcuse me
variableBB=split (mystring," ")(1)
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Gabriel_BrienzaAuthor Commented:
Hi there
it says script outof range
Any Ideas
0
 
Gabriel_BrienzaAuthor Commented:
Another thing,
Variable aa and variablebb can be of any length!
Thanks
Gabriel
0
 
WizOfOzCommented:
xcuse my last post
0
 
Gabriel_BrienzaAuthor Commented:
It works!!
Thanks
Gabriele
0
 
Gabriel_BrienzaAuthor Commented:
Actually it didnt work
Any further suggestions
Thanks
Gabriel
0
 
Gabriel_BrienzaAuthor Commented:
sorry it works actually
APOLOGIES
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.