+ Reply to Thread
Results 1 to 7 of 7

Protect sheet base on Environ("username")

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Protect sheet base on Environ("username")

    Hi, i have the below code

    Please Login or Register  to view this content.
    Its very simple, if the environ("username") = A1, then unprotect. If not protect. However, how do i make a list of environ("username")? Lets say all the username in Column A. If match is not error, then unprotect, if is error protect. How do i amend my code?

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Protect sheet base on Environ("username")

    how many users are you talking about?
    you could just hard code it into the code itself
    Please Login or Register  to view this content.
    Last edited by humdingaling; 04-06-2018 at 03:55 AM. Reason: le LCASE
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Protect sheet base on Environ("username")

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Protect sheet base on Environ("username")

    One way
    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Protect sheet base on Environ("username")

    Quote Originally Posted by kev_ View Post
    One way
    Nice Method

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Protect sheet base on Environ("username")

    @ Sixthsense
    - thank you for the rep
    - I am lazy and prefer to use whole columns to avoid having to determine/specify a range
    - my PC is lazy and prefers not to loop unless no alternative
    Last edited by kev_; 04-06-2018 at 04:12 AM.

  7. #7
    Registered User
    Join Date
    06-03-2015
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    34

    Re: Protect sheet base on Environ("username")

    Nice post !!!!!!!

+ 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. Active Sheet UNLOCKED using Environ("Username")
    By Jarvin24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2015, 09:57 AM
  2. Problem with Environ("username")
    By Doctorul in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-11-2014, 09:35 AM
  3. Parse first name & surname from Windows logon name (Environ("UserName")
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2013, 08:08 PM
  4. [SOLVED] Vlookup Environ ("username") to get proper name and allocate protection
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-04-2012, 04:31 AM
  5. Difference between Environ("USERNAME") and Environ$("USERNAME")
    By ron2k_1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2011, 11:15 AM
  6. [SOLVED] Excel 2002 "Protect Sheet", but Allow "Insert Comments"?
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 12:05 PM
  7. [SOLVED] Excel 2002 "Protect Sheet", but allow "Hide Columns"?
    By VP Safe in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-05-2005, 03:05 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