+ Reply to Thread
Results 1 to 13 of 13

Hide rows as you type

  1. #1
    Registered User
    Join Date
    09-16-2010
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Hide rows as you type

    Hi, I have some programming experience but I'm still pretty new to excel programming. My problem is that I have a sheet of 2500+ items in rows, each item has an ID, Name, Price, Quantity, etc. I have to update the quantity on some items on a daily basis and don't want to have to scroll down, nor do I want to use the find window. I want to have a textbox on top of my rows which, after I type a letter, hides all rows in which the name doesn't start with that letter. For example if I type the letter 's', only items with the letter 's' are displayed while the rest are hidden. If I continue typing, for example 'su' it will further hide the rows where the item doesn't start with 'su', and so on. Also, I want the same text box to have the same effect on ID's. In other words, if I start typing either its name or its ID, it will narrow down the list according to each. How can I do this?????

    Screenshots of what I want are attached...
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Hide rows as you type

    Hi and welcome to the board.
    Why not use the Autofilter ?

  3. #3
    Registered User
    Join Date
    09-16-2010
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Hide rows as you type

    Thanks! And yeah autofilter is fine, but I'm actually making this for someone who has very little excel and computer experience in general and want to simplify it for him as much as I can. Well if a function like that doesn't exist I guess I'll have to settle for autofilter.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Hide rows as you type

    In the attachment an illustration.
    When entering characters in the TextBox, column B will be filtered on the TextBox content.
    Attached Files Attached Files



  5. #5
    Registered User
    Join Date
    09-16-2010
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Hide rows as you type

    WoW!!! Exactly what I was looking for! U da man!
    Is it possible to expand this to include the first row as well?? In other words, if I type in the ID OR name, it will narrow down the list...

    Thanks again!

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Hide rows as you type

    An extended example in the attachment.
    There's 1 caveat: the 'numbers' in column A have to be Text.
    Attached Files Attached Files
    Last edited by snb; 09-17-2010 at 11:43 AM.

  7. #7
    Registered User
    Join Date
    09-16-2010
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Hide rows as you type

    Great! That's just what I need! Thanks a bunch Perhaps your solution can be useful to other people as well... Cheers!

  8. #8
    Registered User
    Join Date
    09-16-2010
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Hide rows as you type

    Another question on the same subject, how can I modify the code to start from the third row instead of the second, or to only work on a table that I specified?

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Hide rows as you type

    To start on the 4th row:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    09-16-2010
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Hide rows as you type

    Perfect.

    Now I have another related problem, I want to protect the workbook from editing but the autofilter doesn't want to work on a protected sheet. Is there a way around this?

  11. #11
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Hide rows as you type

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    09-16-2010
    Location
    Belgrade, Serbia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Hide rows as you type

    I'm gonna say this one more time...
    U DA MAN!

  13. #13
    Registered User
    Join Date
    11-15-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Hide rows as you type

    Hello snb,

    Would you mind helping me with this problem: I want to extend the number of fields to be auto-filtered, more than just 2. However, I couldn't do that as Excel either hide everything after I typed in the textbox, or show "application defined or object defined error".

+ 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