• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Protect file

Veeru106

Member
Hi,


I am working on some file and want to hide certain tabs.


Hidden tabs would be different for different users.


For example, user A can see all tabs , but user B can see only 3 tabs out 5 and so on.


I have a code which allows me to see all tabs as I have mentioned my id in starting “VBA082”.


But I want restricted access for all users which has been mentioned in tab “RAP”.


In RAP tab I want restricted access.


How I can proceed for id mentioned in P2 cell and so on.


I have another code mentioned in workbook, which is for what happened when we open workbook.


Please guide how to proceed further on this.


Attaching file for further reference


Thanks
 

Attachments

  • Book1.xlsm
    25.6 KB · Views: 3
Veeru106
You could control those permits with this sample.
See 'users'-sheet >
> fill left side users (=environ("username") ... if uses MAC then other ...)
> mark 'x' to sheet which can see
<< there is also 'empty'-sheet(column) leave it empty
>>>> empty-sheet is visible while file is closed.
> 'unknown' users would see 'only' 'empty'-sheet ...
Questions?
 

Attachments

  • Book1.xlsm
    35.5 KB · Views: 5
Thansk vletm...but that is not actually working as i thought..

workbook should open at "BLR"Sheet for every one and when they click on button, it shd get visible according to access we have given...
I have made some changes by changing empty sheet with BLR and we dont need empty sheet any more..hence deleted it...
I am the owner of this sheet hence need to see every sheet hence made "users"sheet visible...

now workbook is opening at BLR sheet i can see all tabs...but in users table i guess, idea is to mention user name ids in B col. and mention "x" below the sheet we want to make visible....that is not working....i have mentioned someone id in cell B4 and when i tried to open this file on his machine...it is not showing anything except BLR sheet....Please suggest...Attaching updated sheet
 

Attachments

  • Copy of Book1.xlsm
    31.8 KB · Views: 2
Veeru106 ... I'll try!
Do not change Your id and those marks from 'user' - okay?
... then even You could modify settings - okay?
B-column is for users id (as Yours) - okay?
Columns C ... J are sheets which You can mark as visible - okay?
I've mark for You all sheets visible (except 'empty')
Users 'A' and 'B' were samples for You ( =not real users!)
You changed ... You should add 'SKA500' with real id.
... after add 'SKA500', You'll mark by 'x' those sheets this user can see.
... as You wished ... also 'BLR'-sheet (if not marked to someone, then cannot see!).
After You have made those settings, saved file. Close and open it again.
>> While opening, 'code' will check user id and which sheet user can see. <<
As You 'deleted' You id away, then You didn't have any marked permits there!
... only 'BLR'-sheet can see.
As You might noticed from code ... I forced Your user id for next opening.
' for testing purpose .. next line,
Now I marked it and even You have to log in with correct user id!
= Users computer will tell 'who-are-You' (it's not necessary same who uses it) or ...
If You would like to test, how those user ids works then
.. unhide un = and write user id which You would like to test
> save - close - open ... then You could see that users 'permits'.
Later, that protect should protect too ... not so easy to open/see everything.
... but if You take Your user id away ... then even You cannot see other than BLR.
>> Empty-sheet NEED TO BE THERE! <<
If for some case,
it makes sure that even ONE sheet will be open while close that file and so on ...
but of course ... it's Your choice how to use this.
 

Attachments

  • Copy of Book1.xlsm
    34.2 KB · Views: 4
Back
Top