Solved

Instr problem

Posted on 2002-04-18
9
197 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
  • 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
 

Accepted Solution

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

try this

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now