Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Toggle Button Caption

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Toggle Button Caption

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Toggle Button Caption Al Excel Programming 5 October 20th 06 08:06 PM
Adding .xla button for Toggle Calculation Button Mike Excel Programming 5 August 19th 05 01:55 PM
Toggle change control button face id & caption mikeburg[_2_] Excel Programming 1 June 25th 05 03:00 AM
Place the caption of a toggle button into a cell [email protected] Excel Worksheet Functions 2 May 12th 05 04:47 AM
Toggle custom button caption Tummy Excel Programming 4 February 23rd 04 07:40 PM


All times are GMT +1. The time now is 02:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"