+ Reply to Thread
Results 1 to 3 of 3

String search in a specific location

  1. #1
    Registered User
    Join Date
    11-12-2012
    Location
    warsaw, INDIANA
    MS-Off Ver
    Excel 2007
    Posts
    2

    String search in a specific location

    Hi,

    Could someone help me with this issue? I am trying to find the number "5000" in a column of data, but in a specific location. The specific location is between digits 1 through 4 or 3 through 6.

    The row marked in red is a result of my code looking in the wrong location. I hope this made sense.

    My line of code:

    Please Login or Register  to view this content.
    Thanks

    Vinnie
    2013-01-24 14_42_01-Document1 - Microsoft Word.jpg
    Last edited by Leith Ross; 01-24-2013 at 03:56 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: String search in a specific location

    Hello vnarla,

    Welcome to the Forum!

    The InStr method returns the starting position of the string if it is found. You need to check if the return value is 1 or 3.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-12-2012
    Location
    warsaw, INDIANA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: String search in a specific location

    That trick worked like a charm. Thanks Leith!

    I will keep the formatting in mind for the future.

    Vinnie

+ 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