
Private Sub Workbook_Open()
If Sheets(1).[A1] = 1 Then
Sheets("Foglio1").Visible = False
Else
Sheets("Foglio1").Visible = True
End If
End Sub |
Private Sub Workbook_Open()
If Sheets(1).[A1] = 1 Then
Sheets("Foglio1").Visible = False
'metti qui i fogli che vuoi nascondere
Else
Sheets("Foglio1").Visible = True
'qui i fogli che vuoi scoprire
End If
End Sub |
1:
Option Explicit
Private Sub Workbook_Open()
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ThisWorkbook
Set ws = wb.Sheets(1)
If ws.Cells(1, 1) = 1 Then
For Each ws In wb.Worksheets
Select Case ws.Name
Case Is = "Vedo1", "Vedo2", "Vedo3", "Vedo4"
ws.Visible = 2
Case Else
End Select
Next ws
End If
Set wb = Nothing
Set ws = Nothing
End Sub
2:
Private Sub Workbook_Open()
Dim wsHide As Variant
Dim strW As Variant
wsHide = Array("Vedo1", "Vedo2", "Vedo3", "Vedo4")
If ThisWorkbook.Sheets(1).Cells(1, 1) = 1 Then
For Each strW In wsHide
ThisWorkbook.Worksheets(strW).Visible = -1
Next strW
End If
End Sub
|
ThisWorkbook.Worksheets(strW).Visible = -1 'qui modificare, -1 visibile, 0 nascosto, 2 molto nascosto |
