Script with environ help..

relor

New Member
Joined
Mar 19, 2013
Messages
25
ive been using environ users to edit contents.. and the users not listed with the environ can add contents..

my problem is the users not listed on environ cannot add info.. how do i bypass the environ?

Sub Autorization()
Dim ValidUser
ValidUser = Application.Match(Environ("Username"), Array("agent44", "manager1", "manager4", "manager5", "manager3"), False)
If Not IsError(ValidUser) Then
Sheets("Data").Select
Range("A1").Select
Else
MsgBox Environ("Username") & " does not have access to this file"
ThisWorkbook.Close SaveChanges:=False
End If
End Sub

THIS IS MY ENVIRON SCRIPT.. LISTED ARE THE ADMINS THAT CAN EDIT THE CONTENTS..
HOWEVER, AGENTS CANNOT ADD INFO BECAUSE THE SHEET IS LOCKED BY ENVIRON.. HOW DO I MAKE A BYPASS SO THAT THE AGENTS CAN ADD INFO AND AFTER SAVING THEY ARE NOT ALLOWED TO EDIT THE SHEET...
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,203,543
Messages
6,056,023
Members
444,840
Latest member
RazzelDazel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top