Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7614777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:29:22+00:00 2026-05-31T02:29:22+00:00

Now…I have a workbook with 5 tabs. On tab 1 (the dashboard) I have

  • 0

Now…I have a workbook with 5 tabs. On tab 1 (the dashboard) I have four buttons – each one is basically a link to one of the other four. The reason it’s there with buttons is that only users with ‘admin’ permission to the workbook can go and change data on the other four tabs.

All other users should not be allowed to change any data on those other four tabs. It’s a “look but don’t touch” policy. Oh – to complicate it a little, we then decided they SHOULD be able to change one column on each worksheet.

So. It’s a shared workbook. My piece of code:

Private Sub cmdViewHistology_Click()
    If UserPermsLevel = "High" Or UserPermsLevel = "Super" Then
    Worksheets("Histology and Cytology").Visible = True
    Worksheets("Histology and Cytology").Activate
        Exit Sub
    ElseIf (UserPermsLevel = "Normal" Or UserPermsLevel = "Normal and UserName") Then
        Worksheets("Histology and Cytology").Visible = True
        Worksheets("Histology and Cytology").Range("A:I").Locked = True
        Worksheets("Histology and Cytology").Range("J:J").Locked = False
        Worksheets("Histology and Cytology").Protect DrawingObjects:=False, Contents:=True, Scenarios:=False
        Worksheets("Histology and Cytology").Activate
    Else
        MsgBox "Sorry, this command is not available."
    End If
End Sub

It doesn’t work. Because it’s shared, I know I can’t protect the sheet – which is a shame. The problem is…I need those admin users to be able to change everything, and I need everyone else to be able to look but not touch!

So…does anyone have an alternative approach I could use for this? At the moment my workaround is to disable the four buttons and give them an out of order message which is not winning me any favours…

Really really hoping someone has a bright idea which will help me out of this hole!

Thanking you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:29:24+00:00Added an answer on May 31, 2026 at 2:29 am

    If you know the Windows login for the admin users (or non-admin, whichever is easer) you can use Environ("Username") to check against a list of approved users.

    On the change event of the worksheet, find out what cell is being changed, and if it’s not allowed, then check to see if that specific user has rights to do so.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim EditableRange As Range
    Dim Intersect As Range
        Set EditableRange = Range("A1") ' Set your range appropriately...
        Set Intersect = Application.Intersect(EditableRange, Target)
        If Intersect Is Nothing Then
            'If this is not in the list of editable cells, then check for admin status
            If UserPermsLevel <> "High" And UserPermsLevel <> "Super" Then
                Application.EnableEvents = False
                Application.Undo 'Undo the edits the user made
                Application.EnableEvents = True
                MsgBox "Sorry, this command is not available."
            End If
            'Implied else: allow change
        End If
        'Implied else: allow change
    
    End Sub
    

    Also, you will need to set this code on each of your ‘uneditable’ tabs, or put it in a separate module which is then called by the Private Sub Worksheet_Change(ByVal Target As Range) on each of those tabs, not on the code for the buttons that switch the visible tab.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Now I have a 1-dimonsion NSArray, each element of which is a NSMangedObject with
now form what i have seen in the documentary of twitter bootstrap tabs, the
Now facebook require to have these options when you want to use bulit-in actions
Now I am creating an address book in Java 1.6. Now how I have
Now I'm trying to display the result of consuming a webservice from one page
Now I have a long query and I'd like to alternate with such a
now i have such structure on my server ./site.com/ ./site.com/mage ./site.com/mage/Mage.php ./site.com/mage/app ......... ./site.com/public
Now I have learnt a little bit of assembler (using NASM) I want to
Now that we soon have user defined literals (UDL), in GCC 4.7 for example,
Now i fixed the filtering of file extension but i have a problem on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.