One way is to start with the "Forms" tool bar. Make this appear by right-
clicking in the toolbar area and checking "Forms."
Click on the check box in the Forms tool bar and then click in the
spreadsheet. This should make a check box appear. You can move it around
and resize it.
Then, using
Right-click > Format Control
you can change its appearance and behavior.
Most interesting is Format Control's "Control" tab. Using it, you can
assign a "Cell link," choosing a worksheet cell to store the state of the
check box (checked or not). This lets you do calculations based on this
state.
I just use cell shading as a tickmark when comparing onscreen data
with something on paper. Or a narrow helper column and use whatever
symbol you like.
How about something like this. I use this in my check register to insert a
"X" to show cleared transactions.
Double click on a cell within the range and a "X" is entered. Double click
on the same cell and the "X" is removed.
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("E2:E10000")) Is Nothing Then
With Target
If .Value = "X" Then
.Value = ""
Else
.Value = "X"
End If
End With
Cancel = True
End If
sub_exit:
Application.EnableEvents = True
End Sub
To use this...
Right click on the sheet tab where you want this to work
Select View Code
Copy/paste the above code into the window that opens
Close the window to return to Excel
The above code is set to work in the range E2:E10000. Change the range to
suit your needs.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.