+ Reply to Thread
Results 1 to 5 of 5

using asterisks in a string

  1. #1
    Registered User
    Join Date
    09-14-2009
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    16

    using asterisks in a string

    Hi,

    I have this code:

    Please Login or Register  to view this content.
    and I need to find all cells in a column which containt the text beginning with "Ras".
    But the code above doesn't work because it works with the asterix as if it were a part of the text in the cell.

    Can you help please?
    Last edited by kaipan; 11-14-2009 at 08:51 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: using asterix in a string

    If it's string commencement

    Please Login or Register  to view this content.
    (pending other requirements you may also want to check out the Like Operator in VBA Help)

    Note also VBA by default is case sensitive so ras <> Ras / rAs etc...

  3. #3
    Registered User
    Join Date
    09-14-2009
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: using asterix in a string

    thank you.

    but if it's not a commencement - can I use the asterix?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: using asterix in a string

    You could use InStr or you can investigate use of Like as previously mentioned.

  5. #5
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: using asterix in a string

    InStr
    works e.g
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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