+ Reply to Thread
Results 1 to 4 of 4

Viewing rows by entering password

  1. #1
    Registered User
    Join Date
    03-17-2012
    Location
    ljubljana,slovenia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Viewing rows by entering password

    Hi everybody,

    I'm new to the forum and I'm really counting on your help.

    The problem I'm struggling with in excel is that I would like to create some kind of a filter or a drop down list for selected number of rows, which could only be made visible by entering a password.

    So selected rows would be hidden, but when clicking on a filter or list or checkbox and inputting password they should be visible again.

    Is something like that possible?

    Thank you all for your help.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Viewing rows by entering password

    Hi and welcome to forum.

    Yes, it is possible. However, you need to know that this requires VBA code.
    When opening a workbook containing VBA code (macros), users are prompted to make a choice to enable the macros ( or not ). If they choose to not enable macros then all code is defeated. In short, Excel is not a secure platform.

    I suggest you take this approach:

    Use the Custom Views option (View tab > Custom Views) to set up the various views.

    First, with all rows visible, create a view and name something like "View All".

    Now, say you want to set up a view for "Joe", hide all of the rows you don't want Joe to see then name this view as "Joe's View" (or whatever you like).

    Unhide all rows, then create another view for "Alexis" using the same process.

    After creating all of the various views you need, make sure all rows are visible then hide all rows and name this view as "All Hidden". You should probably leave at least one row visible as you might want to use a drop down list for users to select from (you need a method to allow them to select their rows of data).

    Say we leave row-1 visible and use A1 as the drop down. Cell A1 must be unlocked (Cell Format > Properties, uncheck "Locked")

    Once you've created all of the views, record a macro stepping through the following process:

    Start the Macro Recorder
    Select the View tab on the Ribbon
    Click the Custom Views button and select any view
    Stop the Macro Recorder

    You now have the basic code the call up a view. We jsut need to modify to use the drop down selection.

    We will also need to make sure that the Hide All view is the current view when opening the workbook so that uses do not see anything from a previous view. We must the workbook_open event for this.

    Here is the basic idea and a sample workbook.
    Code used when opening the workbook.

    Please Login or Register  to view this content.
    This code must go into the worksheet module.
    This is basic code - no real error handling.

    Please Login or Register  to view this content.
    The password for the sheet is "Secret"
    "Admin" is the password to show all rows.


    Show Views by Password.xlsm
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    03-17-2012
    Location
    ljubljana,slovenia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Viewing rows by entering password

    Palmetto, thanks a bunch for your reply.

    I have not tried it out yet, but it seems you know your business!

    I will get back as soon as I try it out. I might need some extra help with VBA.


    Thank you once again!

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Viewing rows by entering password

    If you have a long list of users then it may be more efficient to use a loop rather than set up a lot of views.

+ 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