+ Reply to Thread
Results 1 to 4 of 4

How do I find a specific characters position in a string variable

  1. #1

    How do I find a specific characters position in a string variable

    Hi
    I need to find the position of a particular character in a string variable
    within a macro.

    I can do this using the command =FIND(" ",B2) in an excel sheet to return
    the position of the first space in the string in Cell B2.

    What is the equivilent in VBA?

    I am using Excel XP (2002)

    Thanks
    Paul


  2. #2
    Ardus Petus
    Guest

    Re: How do I find a specific characters position in a string variable

    i = instr(string, what)

    HTH
    --
    AP

    "[email protected]" <[email protected]> a
    écrit dans le message de
    news:[email protected]...
    > Hi
    > I need to find the position of a particular character in a string variable
    > within a macro.
    >
    > I can do this using the command =FIND(" ",B2) in an excel sheet to return
    > the position of the first space in the string in Cell B2.
    >
    > What is the equivilent in VBA?
    >
    > I am using Excel XP (2002)
    >
    > Thanks
    > Paul
    >




  3. #3
    David
    Guest

    RE: How do I find a specific characters position in a string variable

    excelmastery?!!?

    Dude. You've totally got to get with inStr(). You will know bounty!!



    "[email protected]" wrote:

    > Hi
    > I need to find the position of a particular character in a string variable
    > within a macro.
    >
    > I can do this using the command =FIND(" ",B2) in an excel sheet to return
    > the position of the first space in the string in Cell B2.
    >
    > What is the equivilent in VBA?
    >
    > I am using Excel XP (2002)
    >
    > Thanks
    > Paul
    >


  4. #4

    RE: How do I find a specific characters position in a string varia

    David
    Worked great, I new it would be simple but I normally do financial models
    and work with numbers not text.
    Thanks
    Paul

    "David" wrote:

    > excelmastery?!!?
    >
    > Dude. You've totally got to get with inStr(). You will know bounty!!
    >
    >
    >
    > "[email protected]" wrote:
    >
    > > Hi
    > > I need to find the position of a particular character in a string variable
    > > within a macro.
    > >
    > > I can do this using the command =FIND(" ",B2) in an excel sheet to return
    > > the position of the first space in the string in Cell B2.
    > >
    > > What is the equivilent in VBA?
    > >
    > > I am using Excel XP (2002)
    > >
    > > Thanks
    > > Paul
    > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1