+ Reply to Thread
Results 1 to 5 of 5

parsing a string

  1. #1
    Mark
    Guest

    parsing a string

    i'm writing a macro from within excel 2003. if i have a string with value
    "abc", how do i select just "ab".

    i tried the left(string,number) function (which i use in VB all the time)
    but i guess within excel that doesnt' work?

    thanks.



  2. #2
    JulieD
    Guest

    Re: parsing a string

    Hi Mark

    umm, left should work .. check out the following


    Sub teststring()
    mystr = "abc"
    MsgBox Left(mystr, 2)
    End Sub

    if you can't get it to work, post your code and we'll have a look.

    --
    Cheers
    JulieD
    check out www.hcts.net.au/tipsandtricks.htm
    ....well i'm working on it anyway
    "Mark" <[email protected]> wrote in message
    news:%[email protected]...
    > i'm writing a macro from within excel 2003. if i have a string with value
    > "abc", how do i select just "ab".
    >
    > i tried the left(string,number) function (which i use in VB all the time)
    > but i guess within excel that doesnt' work?
    >
    > thanks.
    >
    >




  3. #3
    Mark
    Guest

    Re: parsing a string

    you're correct..it does work.. i'm brain dead this morning..
    sorry for wasting your time. (my error was related to something else)
    thx.


    "JulieD" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Mark
    >
    > umm, left should work .. check out the following
    >
    >
    > Sub teststring()
    > mystr = "abc"
    > MsgBox Left(mystr, 2)
    > End Sub
    >
    > if you can't get it to work, post your code and we'll have a look.
    >
    > --
    > Cheers
    > JulieD
    > check out www.hcts.net.au/tipsandtricks.htm
    > ...well i'm working on it anyway
    > "Mark" <[email protected]> wrote in message
    > news:%[email protected]...
    > > i'm writing a macro from within excel 2003. if i have a string with

    value
    > > "abc", how do i select just "ab".
    > >
    > > i tried the left(string,number) function (which i use in VB all the

    time)
    > > but i guess within excel that doesnt' work?
    > >
    > > thanks.
    > >
    > >

    >
    >




  4. #4
    Tom Ogilvy
    Guest

    Re: parsing a string

    As JulieD said, it works in VBA. However, this is often the command you
    will get an error on if you have bad references in Tools=>References. Look
    there after the error and see if you have one or more references marked as
    MISSING. If you do, you need to fix these references.

    References shown in Tools=>References in the VBE are relative to the Active
    Project. Make sure (look in the project explorer window) that your workbook
    is the Active Project (selected in the project explorer window).

    --
    Regards,
    Tom Ogilvy

    "Mark" <[email protected]> wrote in message
    news:%[email protected]...
    > i'm writing a macro from within excel 2003. if i have a string with value
    > "abc", how do i select just "ab".
    >
    > i tried the left(string,number) function (which i use in VB all the time)
    > but i guess within excel that doesnt' work?
    >
    > thanks.
    >
    >




  5. #5
    JulieD
    Guest

    Re: parsing a string

    no probs .. all have days like that

    --
    Cheers
    JulieD

    "Mark" <[email protected]> wrote in message
    news:%[email protected]...
    > you're correct..it does work.. i'm brain dead this morning..
    > sorry for wasting your time. (my error was related to something else)
    > thx.
    >
    >
    > "JulieD" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi Mark
    >>
    >> umm, left should work .. check out the following
    >>
    >>
    >> Sub teststring()
    >> mystr = "abc"
    >> MsgBox Left(mystr, 2)
    >> End Sub
    >>
    >> if you can't get it to work, post your code and we'll have a look.
    >>
    >> --
    >> Cheers
    >> JulieD
    >> check out www.hcts.net.au/tipsandtricks.htm
    >> ...well i'm working on it anyway
    >> "Mark" <[email protected]> wrote in message
    >> news:%[email protected]...
    >> > i'm writing a macro from within excel 2003. if i have a string with

    > value
    >> > "abc", how do i select just "ab".
    >> >
    >> > i tried the left(string,number) function (which i use in VB all the

    > time)
    >> > but i guess within excel that doesnt' work?
    >> >
    >> > thanks.
    >> >
    >> >

    >>
    >>

    >
    >




+ 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