Limit who can use the Shipments sheet.

This commit is contained in:
PhilRunninger 2024-04-01 12:24:14 -04:00
parent 1cf13e4f57
commit 1505221961
2 changed files with 12 additions and 0 deletions

View File

@ -7,3 +7,13 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True Attribute VB_Exposed = True
Private Sub Workbook_Open()
Dim adjuster As Variant
For Each adjuster In shConfig.ListObjects("ShipDateAdjusters").DataBodyRange
If adjuster = Environ("USERNAME") Then
shShipments.Visible = xlSheetVisible
Exit Sub
End If
Next
shShipments.Visible = xlSheetVeryHidden
End Sub

View File

@ -14,6 +14,7 @@ Private Sub Worksheet_Change(ByVal Target As Range)
If shConfig.Range("debug_mode").value Then If shConfig.Range("debug_mode").value Then
shConfig.Visible = xlSheetVisible shConfig.Visible = xlSheetVisible
shShipments.Visible = xlSheetVisible
'shData.Visible = xlSheetVisible 'shData.Visible = xlSheetVisible
shMonthView.Visible = xlSheetVisible shMonthView.Visible = xlSheetVisible
shMonthUpdate.Visible = xlSheetVisible shMonthUpdate.Visible = xlSheetVisible
@ -21,6 +22,7 @@ Private Sub Worksheet_Change(ByVal Target As Range)
shWalk.Visible = xlSheetVisible shWalk.Visible = xlSheetVisible
Else Else
shConfig.Visible = xlSheetVeryHidden shConfig.Visible = xlSheetVeryHidden
shShipments.Visible = xlSheetVeryHidden
'shData.Visible = xlSheetHidden 'shData.Visible = xlSheetHidden
shMonthView.Visible = xlSheetHidden shMonthView.Visible = xlSheetHidden
shMonthUpdate.Visible = xlSheetVeryHidden shMonthUpdate.Visible = xlSheetVeryHidden