Attribute VB_Name = "Foglio4"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Attribute VB_Control = "ToggleButton1, 16, 0, MSForms, ToggleButton"
Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "G"

Select Case ToggleButton1.Value
    Case True
        ToggleButton1.Caption = "Now with 3 sectors"
    Case False
        ToggleButton1.Caption = "Now with 4 sectors"
End Select

Sheets("D1").Unprotect
If ToggleButton1.Value Then
    Application.Sheets("D1").Columns(xAddress).Hidden = True
Else
    Application.Sheets("D1").Columns(xAddress).Hidden = False
End If
Sheets("D1").Protect AllowFormattingCells:=True

Sheets("R1").Unprotect
If ToggleButton1.Value Then
    Application.Sheets("R1").Columns("F").Hidden = True
Else
    Application.Sheets("R1").Columns("F").Hidden = False
End If
Sheets("R1").Protect

End Sub
