Adding Checkboxes

  • Thread starter Thread starter Wes
  • Start date Start date
W

Wes

Could someone tell me how to add check boxes "on the fly"?

I have made a form where the user enters a name then
clicks an "add" button. This enters the name into a list
on a worksheet. I want to place a checkbox beside each
name so the user can later check off names to be used in
other functions. I want the caption to be nothing "" so
that I can place the checkbox directly beside the name.
(I want the names in cells, not in the caption since there
are formulas that need the names.)

Thanks in advance for you advice.
 
I think you will find that the easiest way is to first
record a macro that creates one checkbox in the place you
want.

Then access your macro behind the add button and try a
merge the two macros.

I guess you will have to have some incrementing variable
so you know how many names you have entered and therefore
where to place the checkbox.
 
Thanks for your help!

-----Original Message-----
Wes,

I like to avoid the Check boxes. You can use one of these to use the mouse
click to put an X in column 2. (change to WingDings font and the
appropriate character, you can get a check mark)

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel
As Boolean)
If Target.Column = 2 Then
If IsEmpty(Target) Then
Target = "X"
Else
Target.ClearContents
End If
End If
Cancel = True ' deselects the cell
End Sub

Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range, Cancel
As Boolean)
If Target.Column = 2 Then
If IsEmpty(Target) Then
Target = "X"
Else
Target.ClearContents
End If
Cancel = True ' turns off the menu
End If
End Sub


steve




.
 
Back
Top