hi,
i have an excel wrkbk with 2 sheets,
sheet1 has full data
sheet 2 contains list of users to admin & readonly
Column A Column B
Name Access
Sam Paul Readonly
Tim AK Readonly
Akika YS Admin
John Smith Admin
how can i amend the code to read the sheet2 list of users and make the workbook readonly to e.g sam Paul & Tim AK
ive tried below.. but need to add multiple users want to do it dynamic without change in vba code but read cell values only
If Application.UserName <> 'Akika YS' Then
ThisWorkbook.ChangeFileAccess Mode:=xlReadOnly
End If
i have an excel wrkbk with 2 sheets,
sheet1 has full data
sheet 2 contains list of users to admin & readonly
Column A Column B
Name Access
Sam Paul Readonly
Tim AK Readonly
Akika YS Admin
John Smith Admin
how can i amend the code to read the sheet2 list of users and make the workbook readonly to e.g sam Paul & Tim AK
ive tried below.. but need to add multiple users want to do it dynamic without change in vba code but read cell values only
If Application.UserName <> 'Akika YS' Then
ThisWorkbook.ChangeFileAccess Mode:=xlReadOnly
End If