Place a check box at a particular cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
i'd like somebody to help me for writing a macro to generate a checkbox in a
cell on click of a button.able to add a check box but it is not falling
sequentially in the alternate rows..please somebody help me...i am new to
excel..
 
you could try this solution that I came up with a while back. This is a copy
of that post

Another way is to use this technique of having a check column, and
monitoring it with a worksheet selection change event. Add your code as
needed.

Rather than use a checkbox, I suggest just using a check column. So if we
assume that the data is in A1:E100 (change to suit), clicking in column A
will do what you want with this code.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
With Target
If .Value = "a" Then
.Value = ""
Else
.Value = "a"
.Font.Name = "Marlett"
End If
End With
End If
sub_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
 
Hi,
Using the fine example noted above as a base, is there an extension t
that code that would allow multiple marks with additional clicks? Fo
example, clicking once yields an X. With that X in the box, the nex
click would produce an O. Clicking again would give a third mark etc
Of course, the produced mark would be dependent on font.

Thanks

Jo
 

Ask a Question

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.

Ask a Question

Back
Top