View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Checkbox name linked to a cell

You could use an event macro that looks for a change to a particular cell and
then reacts to that typing change.

If you want to try, then rightclick on the worksheet that owns both the checkbox
and the cell that changes the caption name. Select view code and paste this
into the newly opened code window:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
Exit Sub 'one cell at a time
End If

If Intersect(Target, Me.Range("a1")) Is Nothing Then
Exit Sub
End If

'a checkbox from the Forms toolbar
Me.CheckBoxes("Check box 1").Caption = Target.Value

'a checkbox from the control toolbox toolbar
Me.CheckBox1.Caption = Target.Value

End Sub

I included sample code for both types of checkboxes (from the Forms toolbar and
from the Control toolbox toolbar).

You'll want to delete the code you don't need and make sure the checkbox names
are correct.

Tdp wrote:

How do I link a checkbox to a cell so that when the cell is renamed it also
changes the name in the checkbox?
--
Tdp


--

Dave Peterson