?
Solved

Instr problem

Posted on 2002-04-18
9
Medium Priority
?
216 Views
Last Modified: 2012-05-04

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
0
Comment
Question by:Gabriel_Brienza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 

Expert Comment

by:WizOfOz
ID: 6950994
Why not use split?
variableAA=split (mystring," ")(0)
variableBB=split (mystring," ")(0)
0
 

Expert Comment

by:WizOfOz
ID: 6950997
ops, xcuse me
variableBB=split (mystring," ")(1)
0
 

Author Comment

by:Gabriel_Brienza
ID: 6951018
Hi there
it says script outof range
Any Ideas
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
WizOfOz earned 40 total points
ID: 6951020
variableAA=split(mystring, " ")(0)
variableBB=split(mystring, " ")(1)

try this

0
 

Author Comment

by:Gabriel_Brienza
ID: 6951021
Another thing,
Variable aa and variablebb can be of any length!
Thanks
Gabriel
0
 

Expert Comment

by:WizOfOz
ID: 6951022
xcuse my last post
0
 

Author Comment

by:Gabriel_Brienza
ID: 6951035
It works!!
Thanks
Gabriele
0
 

Author Comment

by:Gabriel_Brienza
ID: 6951145
Actually it didnt work
Any further suggestions
Thanks
Gabriel
0
 

Author Comment

by:Gabriel_Brienza
ID: 6951164
sorry it works actually
APOLOGIES
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question