I'm trying to build a Excel workbook with login acces. Me and my team need to work on the same workbook at the same time on OneDrive Cloud. But I need to hide some worksheet when teamate 'X' open the workbook. When teamate 'Y' work at the same time I don't want to hide any worksheet. However, when teammate 'Y' open the workbook, he unhide all worksheet for everyone one, that's my problem. Could you look at my code and give me some tips!
Private Sub Label3_Click()
Dim WS As Worksheet
'//////////ADMIN USER/////////
If Me.TextBox1.Value = "AHP123" And Me.TextBox2.Value = "AHP123" Or _
Me.TextBox1.Value = "michelle.corneau" And Me.TextBox2.Value = "michelle.corneau" Or _
Me.TextBox1.Value = "linda.daoust" And Me.TextBox2.Value = "linda.daoust" _
Then
For Each WS In Worksheets
WS.Visible = True
Next
Application.Visible = True
Unload Me
'//////////SUPERVISOR USER/////////
ElseIf Me.TextBox1.Value = "lyne.henripin" And Me.TextBox2.Value = "lyne.henripin" Or _
Me.TextBox1.Value = "jf.provencher" And Me.TextBox2.Value = "jf.provencher" _
Then
Worksheets("Productivity Tracking").Visible = True
Worksheets("Grille Des Aquis").Visible = True
Worksheets("Daily Stats").Visible = True
Worksheets("Weekly Stats").Visible = True
Worksheets("MAHP Highlights").Visible = True
Worksheets("Claims").Visible = True
Worksheets("Weekly Performance").Visible = True
Worksheets("Daily Performance").Visible = True
Worksheets("Weekly Forecast").Visible = True
Worksheets("CSO Tire").Visible = True
Worksheets("Deal").Visible = False
Worksheets("APS").Visible = True
Worksheets("Email-Fin de quart").Visible = True
Worksheets("Vacance (Jour)").Visible = True
Worksheets("Vacance (A)").Visible = True
Worksheets("Vacance (B)").Visible = True
Worksheets("Slotting Capacity").Visible = True
Worksheets("Slotting Performance").Visible = True
Worksheets("Rapport OPS").Visible = True
Worksheets("Reception Summary").Visible = True
Worksheets("DWO-New SKU").Visible = False
Application.Visible = True
Unload Me
End If
End Sub
Private Sub Label3_Click()
Dim WS As Worksheet
'//////////ADMIN USER/////////
If Me.TextBox1.Value = "AHP123" And Me.TextBox2.Value = "AHP123" Or _
Me.TextBox1.Value = "michelle.corneau" And Me.TextBox2.Value = "michelle.corneau" Or _
Me.TextBox1.Value = "linda.daoust" And Me.TextBox2.Value = "linda.daoust" _
Then
For Each WS In Worksheets
WS.Visible = True
Next
Application.Visible = True
Unload Me
'//////////SUPERVISOR USER/////////
ElseIf Me.TextBox1.Value = "lyne.henripin" And Me.TextBox2.Value = "lyne.henripin" Or _
Me.TextBox1.Value = "jf.provencher" And Me.TextBox2.Value = "jf.provencher" _
Then
Worksheets("Productivity Tracking").Visible = True
Worksheets("Grille Des Aquis").Visible = True
Worksheets("Daily Stats").Visible = True
Worksheets("Weekly Stats").Visible = True
Worksheets("MAHP Highlights").Visible = True
Worksheets("Claims").Visible = True
Worksheets("Weekly Performance").Visible = True
Worksheets("Daily Performance").Visible = True
Worksheets("Weekly Forecast").Visible = True
Worksheets("CSO Tire").Visible = True
Worksheets("Deal").Visible = False
Worksheets("APS").Visible = True
Worksheets("Email-Fin de quart").Visible = True
Worksheets("Vacance (Jour)").Visible = True
Worksheets("Vacance (A)").Visible = True
Worksheets("Vacance (B)").Visible = True
Worksheets("Slotting Capacity").Visible = True
Worksheets("Slotting Performance").Visible = True
Worksheets("Rapport OPS").Visible = True
Worksheets("Reception Summary").Visible = True
Worksheets("DWO-New SKU").Visible = False
Application.Visible = True
Unload Me
End If
End Sub