Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jul 2005
    Location
    North Carolina, USA
    Posts
    195
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Toggle between Multiple buttons (xp)

    Hi,
    I have an excel sheet that has multiple toggle buttons in one row. and I want the users to be able, just to click and have one button active at a time. I will appreciate any help, Thank you.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Toggle between Multiple buttons (xp)

    Welcome to Woody's Lounge.

    If you want this functionality, it is easier to use radio buttons (aka option buttons). They have a GroupName property, all option buttons with the same GroupName automatically do what you want: clicking one of them turns off all others in the group.

    If you prefer toggle buttons, you have to write code in the On Click event of the toggle buttons, for example

    Private Sub ToggleButton1_Click()
    If Me.ToggleButton1 = True Then
    Me.ToggleButton2 = False
    Me.ToggleButton3 = False
    End If
    End Sub

    Private Sub ToggleButton2_Click()
    If Me.ToggleButton2 = True Then
    Me.ToggleButton1 = False
    Me.ToggleButton3 = False
    End If
    End Sub

    Private Sub ToggleButton3_Click()
    If Me.ToggleButton3 = True Then
    Me.ToggleButton1 = False
    Me.ToggleButton2 = False
    End If
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Jul 2005
    Location
    North Carolina, USA
    Posts
    195
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Toggle between Multiple buttons (xp)

    Thank you so much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •