Environ nightmare

DThib

Active Member
Joined
Mar 19, 2010
Messages
464
Office Version
  1. 365
Platform
  1. Windows
My Inventory workbook has been working well for months. It has a code in the opening that checks for my login ID. It will show a worksheet for me to edit but not anyone else.
2 questions:
1) How do I add 2 more names so they may edit.
2) The other users are now getting the macro slowing to look for the Environ name and then it crashes.
It isn't supposed to and didn't befor last week.

Help!
Code for workbook open below:
Code:
Private Sub Workbook_Open()
 Dim UsedRange
  
  Worksheets("Inventory").Activate
  ActiveSheet.UsedRange.Select
  ActiveSheet.UsedRange.Copy
  Range("A2").Select
  Worksheets("Empty Boxes").Activate
  Range("A1").Select
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
  Range("A2").Select
  Application.CutCopyMode = False
  Worksheets("Inventory").Activate
  Range("A1").Select
  Application.CutCopyMode = False
  Worksheets("Start").Activate
  Range("E3").Select
   Worksheets("Inventory").Visible = xlSheetVisible
  
    If Environ("username") = "dthibode" Then
    'testing - show the sheet
     Worksheets("Inventory").Visible = xlSheetVisible
     Else
    'standard user - completely hide sheet
     Worksheets("Inventory").Visible = xlSheetHidden
    End If
End Sub

Any ideas?:confused::confused::confused:
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Tell your users to activate the Visual Basic Editor, select the workbook in the Project window, choose Tools|References and uncheck any that are marked as MISSING.
 
Upvote 0
Thank you sir. That did it!
Never would have thought of that...

Debbie
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

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