ty all
but something not working
first code i try insert this way:
Code:
Private Sub Workbook_Open()
Dim ConditionString As String ''Dutch For Sheet
Dim X As Integer
ConditionString = "First"
For X = 1 To Sheets.Count
If InStr(1, Sheets(X).Name, ConditionString) Then Sheets(X).Visible = 2 Else Sheets(X).Visible = 1
Next X
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ConditionString As String ''Dutch For Sheet
Dim X As Integer
ConditionString = "First"
For X = 1 To Sheets.Count
If InStr(1, Sheets(X).Name, ConditionString) Then Sheets(X).Visible = 1 Else Sheets(X).Visible = 2
Next X
End Sub
this works only if i close first time my workbook.
if i reload my work, vba gives the following error:
Unable to set the Visible property of the Worksheet class
Richie code works for me ty

on open i only had to add the following code:
Worksheets("First").Visible = 2
but i also had to add