Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERTING "CHECK BOX" 2

Status
Not open for further replies.

xsubzeroz

Technical User
Oct 15, 2002
39
CA
I have a sheet that I need to have check boxes for different fields. I wanted to know if I can insert check box so that if I finish something, I can double click and have checkmark to be put into that box. Thanks.
 
An alternative to inserting multiple check-boxes...

Consider formatting the cells with the "Webdings" font which I believe is one of the basic Windows fonts.

Then, simply enter the letter: "a" (lower case)

Hope this helps.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Dale,

That's pretty neat. After checking it out, I took your idea and ran with it a little. The following will allow the user to double-click an appropriate cell (Column C for this example) to toggle the checkmark on/off. As written, it requires the the Webdings font to be set ahead of time, but this could be done in the procedure, as well.

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)

  If Not Application.Intersect(Target, Me.Range("C:C")) Is Nothing Then
    If Target.Value = "a" Then
      Target.ClearContents
    Else
      Target.Value = "a"
    End If
    Cancel = True
  End If
End Sub

xsubzeroz -- If you want to use this and need help implementing, post back.


Regards,
Mike
 
Can you turn on the forms toolbar and insert a check box? The value of the check box can then be linked to another cell.

VW....
 
Mike can you please help me with this feature. I have never used visual basic but would love to learn a little bin. Can you show me how to do it. Thank you very much.
 
What I'm actually looking for is to have lets say in column A (A1:A10) square check boxes. I would like to double click inside check box and be able to put check mark in there or double click and take check mark off. Is that possible? I really appreciate your help. Thanks.
 
xsubzeroz,

Based on your post, it looked like you were interested in checkmarks for visual feedback and Dale Watson's suggestion was a neat way to achieve that; very easy to implement and format. I simply added code to give it the functionality you wanted.

However, if you want the look of an actual checkbox, that can also be done. One way, as VW suggested, is to use the Forms toolbar and insert a checkbox control from it. I prefer to use the Control Toolbox toolbar. Again, you would display this toolbar then select and place the checkbox control in a worksheet cell. You would need to size and position these for proper display. Both the Forms version and Control Toolbox version toggle a checkmark on/off with a single click, not a double click.

If this is for display purposes only, no VBA code is needed. Only in the case where you want some action carried out upon checking/unchecking would you need code.

Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top