Re: how can I make an excel cell "mark" or "unmark" when clicked on?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
Active***.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" <Rick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B850FC8E-A9E7-4CC4-8729-7121F7183327@xxxxxxxxxxxxxxxx
> how can I make an excel cell "mark" or "unmark" when clicked on?


.


Quantcast