Excel VBA Code to unlock sheets depending on user

  • [INDENT]Hello All,


    I have a spreadsheet that I would like to write code so depending on your USER ID (windows login) will show certain sheet. I know how to get the user id using Environ("username")


    so for eg USER 1 - Access to all sheets
    USER 2 - Access to sheet 2 only
    USER 3 - Access to sheet 3 only.


    I have searched various forums / sites but to no avail. I am not even a novice in VBA so if possible treat any answers like your speaking to a 5 year old.


    This is as close as I have came but no results or errors.
    Private Sub User_Name()


    [INDENT]

    [/INDENT]
    Any help pointing me in the right direction would be greatly appreciated.
    ps I know this is not 100% secure but will only be used for a small group of people with non-confidential data [/INDENT]

  • Re: Excel VBA Code to unlock sheets depending on user


    Hi There and welcome to the forum, you have posted your question in the "hire help" forum, and as such, you need to indicate how much you are willing to pay for a solution. Alternatively, I can move your thread to the Excel Help forum, which is a free forum.

    Regards,


    Wigi


    Excel MVP 2011-2014


    For more Excel memes: visit http://www.wimgielis.com ==> English articles ==> Excel memes


    -- Topics without [CODE] tags or a meaningful topic title, will be neglected by me (and probably many others as well) --

  • Re: Excel VBA Code to unlock sheets depending on user


    and no code tags.... :( *sigh*

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

  • Re: Excel VBA Code to unlock sheets depending on user


    Topic closed.


    iamlost, please pay attention to the forum rules.
    If not, your username will be banned.

    Regards,


    Wigi


    Excel MVP 2011-2014


    For more Excel memes: visit http://www.wimgielis.com ==> English articles ==> Excel memes


    -- Topics without [CODE] tags or a meaningful topic title, will be neglected by me (and probably many others as well) --

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!