View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier
 
Posts: n/a
Default how can I make an excel cell "mark" or "unmark" when clicked on?

Hi Rick

In addition to the method already posted, you could use something like
the following.

Private Sub AddCheckBoxes()
Dim c As Range, myRange As Range
Set myRange = Selection

For Each c In myRange.Cells
ActiveSheet.CheckBoxes.Add(c.Left, c.Top, c.Width,
c.Height).Select
With Selection
.LinkedCell = c.Address
.Characters.Text = ""
End With
With Selection.Font
.ColorIndex = 2
End With
Next
myRange.Select

End Sub

The ColorIndex part is just setting the font to be White, so that you
don't see the word TRUE when you select the click box.
The value of the underlying cell will be set to True when clciked, and
False when unclicked.


--
Regards

Roger Govier


"Rick" wrote in message
...
how can I make an excel cell "mark" or "unmark" when clicked on?