+ Reply to Thread
Results 1 to 17 of 17

Filter results based on cell value and print results

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    Canton, Ohio
    MS-Off Ver
    2010
    Posts
    48

    Filter results based on cell value and print results

    Hi All, I am having trouble getting this to work. I have an spreadsheet with data from columns A5 to P5 with continually growing rows. Row 4 is the header row. I would like to be able to enter a value into cell E2 and have the results filtered based on that input. I would like the filter to produce results if Column B contains the data entered in E2. After various searches I found this code that applied to my situation but I cannot get it to work. Thank you in advance for any help.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by MPXJOHN; 09-24-2018 at 03:04 PM. Reason: Code tags

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 6)

    Attach an EXCEL sample to be sure macros are running with real data
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    12-18-2012
    Location
    Canton, Ohio
    MS-Off Ver
    2010
    Posts
    48

    Re: Filter results based on cell value and print results

    Updates made. Sorry for the oversight.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    See next code
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    In addition see file attach and the validation list for cell E2
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-18-2012
    Location
    Canton, Ohio
    MS-Off Ver
    2010
    Posts
    48

    Re: Filter results based on cell value and print results

    This code works, but I need to be able to enter the CABLE# manually into Cell E2 and have it filter if column B "contains" what I have entered so whoever uses this does not have to scroll thru a large database of numbers or be required to type them in exactly as they are in the filtered list. Is there a way to accomplish this?

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    What is the issue with the last file sent ?
    There is a validation list for E2 and the macro is fired when the value is entered ...no ?

  8. #8
    Registered User
    Join Date
    12-18-2012
    Location
    Canton, Ohio
    MS-Off Ver
    2010
    Posts
    48

    Re: Filter results based on cell value and print results

    The problem is I have to enter the value "exactly" as it is typed in the list which I want to avoid having to do. I want it to filter when I enter say just the beginning of the Cable#. So in the sample file I would only have to type "12345" for the filter to work.

  9. #9
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    and when entering "12345"
    you want to display all Cable# starting by "12345" !!

  10. #10
    Registered User
    Join Date
    12-18-2012
    Location
    Canton, Ohio
    MS-Off Ver
    2010
    Posts
    48

    Re: Filter results based on cell value and print results

    That is correct.

  11. #11
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    See next code
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-18-2012
    Location
    Canton, Ohio
    MS-Off Ver
    2010
    Posts
    48

    Re: Filter results based on cell value and print results

    Good morning. With this code I receive an error when typing into cell E2.
    Error Message.JPG

  13. #13
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    Yes this is because there is a validation list which must not exist anymore if you want to enter partial part of the input
    See file file attached
    Else select E2, then Data > Data Validation > Allow > Any value
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    12-18-2012
    Location
    Canton, Ohio
    MS-Off Ver
    2010
    Posts
    48

    Re: Filter results based on cell value and print results

    Attached file is not working. Nothing happens when I enter a value into E2.

  15. #15
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    Yes I apologize, wrong file
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    12-18-2012
    Location
    Canton, Ohio
    MS-Off Ver
    2010
    Posts
    48

    Re: Filter results based on cell value and print results

    Works perfectly!! Thank you!!

  17. #17
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter results based on cell value and print results

    Good, we got it.
    Have a look to closed the thread

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. limit filter results count or paste results in range
    By incobart in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-28-2017, 06:33 AM
  2. Replies: 3
    Last Post: 04-27-2017, 05:25 PM
  3. When data is entered into cell results in print or do not print.
    By Bikeman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-31-2016, 04:37 PM
  4. Macro to filter then print results
    By a71rambler in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-28-2014, 12:03 PM
  5. [SOLVED] Adding a value to a column based on filter results
    By JohnnyBoyxxx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2014, 05:53 AM
  6. Replies: 4
    Last Post: 11-07-2012, 02:57 PM
  7. Replies: 3
    Last Post: 03-31-2010, 11:47 AM

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