+ Reply to Thread
Results 1 to 1 of 1

Search for any string / text greater than AND for string / text less than input box

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

    Question Search for any string / text greater than AND for string / text less than input box

    What I am having such a hard time with is I want the user to be able to input a starting string and an ending string. Then I want to find any cells in A that match the starting string or greater than the starting string AND match the ending string or less than the ending string.

    If there is a match on xstartlin AND a match on xendlin, then I want to loop through all the cells and find any that are equal to, greater than starting or less than ending and I want to place an X in the last column on the file and then after the X has been placed in the matched records, after the search has completed I want to copy all the rows that have an X in the column in the file to a new sheet, exactly as they are displayed on the old sheet.

    I am lost on how to accomplish this. I have figured out how to get the user input and make sure it's upper case and it does find a match in my cells.find statement but after that I've tried many different things and nothing seems to work. The data could be alpha, numeric or alpha-numeric. I'm using Excel 2007. I've attached a sample file. Thank you for any assistance.
    ===================================================================

    sub snippit_findmany()

    Dim xstartlin As String
    Dim xendlin As String

    xstartlin = InputBox("What is the starting LIN?")
    xstartlin = UCase(xstartlin)

    xendlin = InputBox("What is the ending LIN?")
    xendlin = UCase(xendlin)

    With Sheets("INVENTORY").range("A:A")
    range("A1").Select
    .Offset(0, 13).ClearContents

    Cells.Find(What:=xstartlin, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate

    ==============================================================================================
    Attached Files Attached Files
    Last edited by JaneinExcel; 01-15-2013 at 10:12 AM. Reason: Change Title
    Thanks for your time and help!

    Jane

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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