Private Sub CommandButton2_Click()
Dim ws As Worksheet
Select Case Me.TextBox1.Value
Case "MC"
ThisWorkbook.Application.Visible = True
Me.Hide
Case "MC1"
For Each ws In ThisWorkbook.Worksheets
If ws.Range("B2").Value = "Planification et maintenance" Then
ws.Visible = True
End If
Next ws
Case "MC2"
For Each ws In ThisWorkbook.Worksheets
If ws.Range("B2").Value = "Pole Essais" Then
ws.Visible = True
End If
Next ws
Case Else
MsgBox ("veuillez entrer un mot de passe valide !")
End Select
ThisWorkbook.Application.Visible = True
End Sub