Testtest11
Testtest11

Reputation: 367

Toggle button in Excel Online

What I can use except button in online Excel? It's not allowed:

We can't show these features in the browser:

• Objects like form toolbar controls, toolbox controls, and ActiveX controls But you can see all the content in this workbook by opening the file in Excel.

I just wanted to give end user solution for hidding/showing many group of columns.

Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "L:P"
If ToggleButton1.Value Then
    Application.ActiveSheet.Columns(xAddress).Hidden = True
Else
    Application.ActiveSheet.Columns(xAddress).Hidden = False
End If
End Sub

Upvotes: 0

Views: 1227

Answers (1)

Liss
Liss

Reputation: 441

You can use a CheckBox.

If CheckBox1.Value = True Then 
    Application.ActiveSheet.Columns(xAddress).Hidden = True
Else
    Application.ActiveSheet.Columns(xAddress).Hidden = False
End If

Upvotes: 1

Related Questions