Article ID: 166252
Article Last Modified on 11/23/2006
'Variable to hold name of ToggleButton that was clicked.
Public Clicked As String
Sub ExclusiveToggleButtons()
Dim Toggle As Control
'Loop through all of the ToggleButtons on Frame1
For Each Toggle In UserForm1.Frame1.Controls
'If Name of ToggleButton matches name of ToggleButton
'that was clicked...
If Toggle.Name = clicked Then
'...select the button
Toggle.Value = True
Else
'...deselect the button
Toggle.Value = False
End If
Next
End Sub
Private Sub ToggleButton1_MouseUp(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Clicked = ToggleButton1.Name
Application.OnTime Now, "ExclusiveToggleButtons"
End Sub
Private Sub ToggleButton2_MouseUp(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Clicked = ToggleButton2.Name
Application.OnTime Now, "ExclusiveToggleButtons"
End Sub
Private Sub ToggleButton3_MouseUp(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Clicked = ToggleButton3.Name
Application.OnTime Now, "ExclusiveToggleButtons"
End Sub
120802 Office: How to Add/Remove a Single Office Program or Component
Additional query words: 97 XL97 toggle
Keywords: kbdtacode kbhowto kbprogramming KB166252