+ Reply to Thread
Results 1 to 4 of 4

How to make a cell a generic checkbox

Hybrid View

  1. #1
    Registered User
    Join Date
    03-10-2008
    Posts
    2
    This is (almost!) exactly what i've been looking for...
    http://www.excelforum.com/showthread.php?t=576315

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Target = "X"
    End Sub
    All i need help with now, is how i get this to work just in one column or a range of cells (eg A3:A20)?

    Any help would be greatly appreciated!
    Thanks
    Last edited by VBA Noob; 03-10-2008 at 08:11 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526
    Try This
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Union(Range("$A$3:$A$20"), Target).Address = Range("$A$3:$A$20").Address Then
            Cancel = True
            If Target = "r" Then
                Target = ""
            Else
                With Target.Font
                    .Name = "Webdings"
                    .Size = 10
                End With
                Target = "r"
            End If
        End If
    End Sub
    Double click to get an X,
    double click on an X to clear it
    Last edited by davesexcel; 03-10-2008 at 08:12 AM.

  3. #3
    Registered User
    Join Date
    03-10-2008
    Posts
    2
    Thanks Davesexcel!
    That works perfectly. Just what i was after.
    If only everything in life could be sorted out so quickly!

    Again, thanks!

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526

    Make check marks in a cell

    Quote Originally Posted by Cheeba
    Thanks Davesexcel!
    That works perfectly. Just what i was after.
    If only everything in life could be sorted out so quickly!

    Again, thanks!
    Thanks for the feed back,
    I have always liked that way of creating "X" marks, if you change the code to "a" instead of "r" you will get a check mark

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1