+ Reply to Thread
Results 1 to 8 of 8

Filtering rows in a column based on a string value search in excel worksheet.

  1. #1
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Filtering rows in a column based on a string value search in excel worksheet.

    Hi there,

    I would like find a way to perform searching in Excel 2010 with the aid of VBA.

    How it should work:

    1) users will click on the "locate" box to bring up a search box
    2) system passes whatever strings user specifies in the box to the spreadsheet and it will then filter column A based on the value specified.
    3) system will then help users locate the rows where that searched string is stored. (it can be more than one rows returned)

    Is this possible?

    I have the following partial coding in there, but am stuck as to how to build in this input box and the code for filtering..

    Please Login or Register  to view this content.
    Any ideas?
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Filtering rows in a column based on a string value search in excel worksheet.

    system passes whatever strings user specifies in the box to the spreadsheet and it will then filter column A based on the value specified.
    Column A on which sheet? Irrespective of the sheet, there is just "K" in column A of both sheets.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Re: Filtering rows in a column based on a string value search in excel worksheet.

    Quote Originally Posted by arlu1201 View Post
    Column A on which sheet? Irrespective of the sheet, there is just "K" in column A of both sheets.
    Hi Arlu,

    Sorry I wasn't being clear.

    I have re-attached the file.

    so users will search in column B by invoking in that button, and because the relationship between values in col A and B are many to many, I would like Excel to filter rows that contain the string being searched for.(so for example, if we are searching for "K95300001", then only two entries should appear because that K string is contained in two rows.)

    Also, is it possible that the search is NOT exact match? I find that users just type in some strings and as long as they match the actual string, it is fine.

    Does this make sense?

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Filtering rows in a column based on a string value search in excel worksheet.

    So for this question that you have, sheet 1 and sheet 2 are not related at all right? We do not need to use sheet 2, right?

  5. #5
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Re: Filtering rows in a column based on a string value search in excel worksheet.

    Quote Originally Posted by arlu1201 View Post
    So for this question that you have, sheet 1 and sheet 2 are not related at all right? We do not need to use sheet 2, right?
    No, just sheet1 please.

    Thanks

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Filtering rows in a column based on a string value search in excel worksheet.

    Use this code -
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Re: Filtering rows in a column based on a string value search in excel worksheet.

    Hi Arlu,

    If user searches a string in column B, can he do so?

    I have tried to put in a string that is found in col B in the inputbox, but Excel just kind of filers the entire page out wihtout showing me any row.

    Searching on col A works,and it is amazing to have just these few lines to do what I would like to do!

    Thanks

  8. #8
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Re: Filtering rows in a column based on a string value search in excel worksheet.

    oh nvm, I think I got it.

    I changed the range to be filtered on. lol

+ 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