Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
denis115
Creator
Creator

conditional hide based on user

Hello !

Help me pease !

What condition I must put in sheet properties to achieve what I want?

I need to hide a sheet from only one user , another users must see this sheet, how can I do this?

Thanks !

I'm using ntname section  access.

I find a condition but it doesnt hepled me: if(osuser()='ntname',1,0)

1 Solution

Accepted Solutions
Anil_Babu_Samineni

May be this?

If(Match(OSUSER(), 'ntname'),1,0)

OR

If, this is from Authentication of Section Access, you could use this

if(Match(QVUSER(), 'ntname'),1,0)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

25 Replies
farru_scorpio
Contributor III
Contributor III

Dear Cucuta,

Please remove if and write only as below in sheet properties > General > Show Sheet > Conditional:

osuser() = 'ntname'

for multiple user access you can use "or" between conditions.

Cheers

denis115
Creator
Creator
Author

osuser() = 'dtest'     but it hide this sheet and for other user, for me as admin also hides

farru_scorpio
Contributor III
Contributor III

Dear Cucuta,

As I said for multiple user you have to add or like below:

osuser() = 'user1' or osuser() = 'user2' or osuser() = 'user3' .... and so on.


Sheet will be available only mentioned users above.


Good Luck!

denis115
Creator
Creator
Author

I enter as user

osuser() = 'dcucuta'

and it hide sheet 

denis115
Creator
Creator
Author

thats my example

password for hidden script is :  denis

avinashelite

try like this in the sheet properties >general >conditional

if(osuser() = 'dcucuta',0,1) this will hide the sheet when dcucuta login and show the sheet for all others

denis115
Creator
Creator
Author

tresesco
MVP
MVP

Try not equal instead, like:   =osuser() <> 'dcucuta'      // this will make the sheet visible to all except user 'dcucuta'

vardhancse
Specialist III
Specialist III

Hi can try below:

Section Access;

LOAD ACCESS,

     NTNAME,

     SAREP,

     NM

FROM

'..\..\..\Dashboard\SectionAccess.xlsx'

(ooxml, embedded labels, table is SA);

Then you add the sheet access coding directly underneath

Section Application;

Sheet_Security:

LOAD USERS as NM,

     SH01,

     SH02,

     SH03,

     SH04,

     SH05,

     SH06,

     SH07,

     SH08

FROM

'..\..\..\Dashboard\SectionAccess.xlsx'

(ooxml, embedded labels, table is SHEETS);

My Section Access table looks like you would expect and the NM column is to specify their role, MGR or NON for different sheet access, i.e.

NTNAME   SAREP   NM

him            Richard   NON

her             Mike       NON

mgr1           *            MGR

mgr2           *            MGR

and the Sheets Table looked like so:

USERS  SH01  SH02  SH03.... SH07 SH08

NON         1         1         1           0        0

MGR         1         1         1           1        1

Then set the condition property for each respective sheet to show if the flag for that sheet is 1, i.e.:

SH08=1

Then reload!