+ Reply to Thread
Results 1 to 13 of 13

Hide All Rows and Display only one row based on User input

  1. #1
    Registered User
    Join Date
    01-19-2016
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Hide All Rows and Display only one row based on User input

    Hi,

    I am very new to VBA and I have a requirement to hide all rows when a user opens an excel and based on an input box(employee id) ,show only the row of the employee id provided in the input box.

    I am able to write the codes separately for an input box and hide all rows but I cant put everything together.

    Appreciate if I could any pointers on how to implement this code in vba?

    Thanks

    Neeta

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide All Rows and Display only one row based on User input

    Welcome to the forum
    As for your request please attach a sample workbook ..
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    01-19-2016
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: Hide All Rows and Display only one row based on User input

    Hi,

    Thanks for your quick reply.I have attached the document on which I am trying to implement this logic.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide All Rows and Display only one row based on User input

    Try this code
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-14-2014
    Location
    Estonia
    MS-Off Ver
    2013 Office for Mac
    Posts
    31

    Re: Hide All Rows and Display only one row based on User input

    Quote Originally Posted by YasserKhalil View Post
    Try this code
    Please Login or Register  to view this content.

    That code looks awesome, but where should the ID Code be hosted?

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide All Rows and Display only one row based on User input

    I didn't get your question ...
    But as I got your words, The ID codes would be in column A

  7. #7
    Registered User
    Join Date
    01-19-2016
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: Hide All Rows and Display only one row based on User input

    YasserKhalil

    Thanks for your inputs.I will put this code in my excel and get back to you for any questions.

  8. #8
    Registered User
    Join Date
    01-19-2016
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: Hide All Rows and Display only one row based on User input

    YasserKhalil

    The code you sent works perfect but I have 2 issues still


    1.The first time I open the sheet,I can see all data.I need the data to be hidden first and based on the input box condition it needs to show the data
    2.When I enter any value which is not in the list,it shows me all the data available.

    Can you help me with these issues too?

    Thanks

  9. #9
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide All Rows and Display only one row based on User input

    Ho Neetag
    As for first point : you can add this line in thisworkbook open event
    Please Login or Register  to view this content.
    The same thing with point two , I will add the same line in the second part of the IF conditional
    I
    Please Login or Register  to view this content.
    In satndard module
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-19-2016
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: Hide All Rows and Display only one row based on User input

    Thanks YasserKhalil.It worked.

  11. #11
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide All Rows and Display only one row based on User input

    You're welcome. Thanks for the feedback and for the rep points
    Glad I can offer some help

    Please mark the thread as solved

  12. #12
    Registered User
    Join Date
    11-19-2020
    Location
    Malaysia``
    MS-Off Ver
    Office Pro Plus 2013
    Posts
    1

    Re: Hide All Rows and Display only one row based on User input

    How to get it autorun when opening a workbook? I'm using Excel 2013. It just shows blank table after being opened and had to run the macro manually from Developer tab.
    Last edited by risma75; 11-19-2020 at 03:20 AM.

  13. #13
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,642

    Re: Hide All Rows and Display only one row based on User input

    Administrative Note:

    Hello risma75 and welcome to the Excel Forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Insert # of Rows based on User Input
    By afpilotb1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2014, 11:40 AM
  2. Hide/unhide rows based on form input
    By Nicolas Mous in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-17-2014, 10:49 AM
  3. Hiding rows based on a user input box
    By jshaw82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2013, 06:34 PM
  4. [SOLVED]Hide Rows and Columns Based on User Input
    By thesteve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2013, 01:32 PM
  5. [SOLVED] Macro to search through dates and display results based on user input
    By Alan668 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-22-2012, 12:40 PM
  6. Delete rows based on user input
    By Militia in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-10-2009, 06:33 AM
  7. unhide/hide rows based on value input
    By whoosh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2009, 11:25 PM

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