Caption

ovadeso

Board Regular
Joined
Sep 23, 2004
Messages
150
Hi there Guys,
I have a question for you. I don't know if this was ever answered before, but here it is.
What code (if any) could be used to change the Caption on a toggle botton depending on wether its up or down (on or off)?. Thanks in advance.
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,069
Office Version
  1. 2016
Platform
  1. Windows
Try this :

Code:
Private Sub ToggleButton1_Click()

    If ToggleButton1 Then
        ToggleButton1.Caption = "Down"
    Else
        ToggleButton1.Caption = "Up"
    End If

End Sub

Regards.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,921
Messages
5,575,043
Members
412,636
Latest member
XinZ
Top