+ Reply to Thread
Results 1 to 8 of 8

Filter from sheet1 to sheet2

  1. #1
    Registered User
    Join Date
    05-14-2013
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question Filter from sheet1 to sheet2

    Hello everybody, I'm very new for this. Now I'm an internship at IT Center.

    now I have tons of clients' information in sheet1. My task is to

    create sheet2 with 2 boxes and a button. when I fill in a keyword

    for example, name of client in box1 or client's ip address in box2 (or maybe both),

    then I click the button, it will automatically give all information in every rows which contain keyword I type in.

    How can I create a VBA for this? Assign Macro at button?

    Any help would be much appreciate. Thank you in advance.

  2. #2
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Filter from sheet1 to sheet2

    Sorry, but you lost me when you say, "give all information in every rows which contain keyword I type in."

    If you could post a small file of exactly what the desired result will look like (before and after) that would help a lot.

  3. #3
    Registered User
    Join Date
    05-14-2013
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Filter from sheet1 to sheet2

    Quote Originally Posted by Ed_Collins View Post
    Sorry, but you lost me when you say, "give all information in every rows which contain keyword I type in."

    If you could post a small file of exactly what the desired result will look like (before and after) that would help a lot.

    Thank you for your reply. Here I post the file with example in both sheet1 and sheet2.

    Please kindly take a look at it.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-14-2013
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Filter from sheet1 to sheet2

    I'm quite confused with the vba. Please helpp T.T

  5. #5
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Filter from sheet1 to sheet2

    Play around with this and let me know if this helps you.

    example-1 modified.xlsm

  6. #6
    Registered User
    Join Date
    05-14-2013
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Filter from sheet1 to sheet2

    Quote Originally Posted by Ed_Collins View Post
    Play around with this and let me know if this helps you.

    Attachment 236036
    Thank you very much. It helps a lot! One more question, if I want to fill in 'anything' in the box

    not just province and name, how to do that?

  7. #7
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Filter from sheet1 to sheet2

    Well... right now if you want filter the criteria by Number or by Surname or IP, the program will have to be modified. Currently it's only searching by Province, if that province box is filled in, and/or by First Name, if that first name criteria box is filled in. (As per your example.)

    Ideally, just use my code as an guide, and add another couple of criteria boxes, and modify the code to search the two boxes in the same manner.

    If you don't add two more criteria boxes, the logic becomes a bit trickier. For example, if you don't add two more boxes, but you enter a surname in the first name field, the program would have to be "smart enough to know" (figure out) that the name you're entering is a Surname and not a first name. Or, it has to "know" that you're entering an IP address and search the IP column, instead of say a name column or a province column, etc.

  8. #8
    Registered User
    Join Date
    05-14-2013
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Filter from sheet1 to sheet2

    wow! that helps a lot. I must ask your permission to use your code as a guide.
    Thank you again. I'll try to implement it in order to meet the requirement as much as possible.

+ 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