Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have a spin button on my worksheet which controls the contents of a particular cell. I also have a toggle box on the same worksheet. I need the caption on the toggle box to change in real time as the cell changes. Does anyone have any ideas as to how this might be achieved? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1" '<== change to suit On Error GoTo ws_exit Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target If .Value < "" Then Me.OLEObjects("ToggleButton1").Object.Caption = .Value End If End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "5elpep" wrote in message ups.com... Hi all, I have a spin button on my worksheet which controls the contents of a particular cell. I also have a toggle box on the same worksheet. I need the caption on the toggle box to change in real time as the cell changes. Does anyone have any ideas as to how this might be achieved? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Toggle Button Caption | Excel Programming | |||
Adding .xla button for Toggle Calculation Button | Excel Programming | |||
Toggle change control button face id & caption | Excel Programming | |||
Place the caption of a toggle button into a cell | Excel Worksheet Functions | |||
Toggle custom button caption | Excel Programming |