Adding multiple choices to a "Check Box"

EE Pros,

EE Pro MartinLiss helped write some code that has been very helpful in building out a check box selection on a worksheet.  I'm trying to get the box to now cycle through three stages;
1.) A check
2.) An X
3.) A Question Mark

By clicking on the box, the proper letter is exposed and then based on the font, will display the appropriate sign.

That's it!

Here is the code being used now:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Provides check button
If Target.Column = 5 Then

    Application.ScreenUpdating = False
    With ActiveCell
        If .Value = "P" Then
            .Value = ""
            .Offset(0, 4).ClearContents
        ElseIf .Offset(0, 1).Value <> "" Then
            .Font.Name = "Wingdings 2"
            .Value = "P"
            .Offset(0, 4).FormulaR1C1 = ""            '"=Value"    'Value is not a defined name
        End If
   
    End With
    Cancel = True
    Application.ScreenUpdating = True
End If

If Target.Column = 4 Then
    If ActiveCell.Offset(0, -3).Value = "2" Then
   
        Application.ScreenUpdating = False
        With ActiveCell
            If .Value = "P" Then
                .Value = ""
            ElseIf .Offset(0, 1).Value <> "" Then
                .Font.Name = "Wingdings 2"
                .Value = "P"
            End If
       
        End With
        Cancel = True
        Application.ScreenUpdating = True
       
    End If
End If


If Target.Column = 3 Then
    If ActiveCell.Offset(0, -2).Value = "1" Then
   
        Application.ScreenUpdating = False
        With ActiveCell
            If .Value = "P" Then
                .Value = ""
            ElseIf .Offset(0, 1).Value <> "" Then
                .Font.Name = "Wingdings 2"
                .Value = "P"
            End If
       
        End With
        Cancel = True
        Application.ScreenUpdating = True
       
    End If
End If
End Sub






Thank you in advance,

B.
Bright01Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Try the attached. If you also need to clear any other cells on the row please let me know.
28691217.xlsm
0
Bright01Author Commented:
Martin,

Great!  Looks like you broke the code.  However, ..... it only works in the first three cells and if you use the "Clear Button", it doesn't re-establish the macro capability.  But you are clearly on the right track!!!!

B.
0
Martin LissOlder than dirtCommented:
Find the "Toggle" sub in the 'Architecture_Questions' sheet code and replace it with this one. The previous version ignored blank cells, while this one changes a blank cell to a check.

Private Sub Toggle(cel As Range)
     Application.ScreenUpdating = False
     
     Select Case cel.Value
        Case "P" ' It's a checkmark so change to !
            cel.Font.Name = "Calibri"
            cel = "?"
        Case "?" ' it's an ? so change it to X
            cel.Font.Name = "Wingdings 2"
            cel = "O"
        Case "O" ' It's an X so change it to a checkmark
            cel.Font.Name = "Wingdings 2"
            cel = "P" ' This is a checkmark in the Wingding 2's font
        Case Else
            If cel.Value = "" Then
                cel.Font.Name = "Wingdings 2"
                cel = "P" ' This is a checkmark in the Wingding 2's font
            End If
    End Select
    Application.ScreenUpdating = True

End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Bright01Author Commented:
Martin,

THAT IS "WAY COOL"!!!!  I don't know how you figured out how to do it but what an outstanding, innovative addition!

As always, appreciate your willingness to jump into these opportunities and always appreciate your skills and capabilities.

Much thanks,

B.
0
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
0
Bright01Author Commented:
Martin,

If I wanted to add one more "click" that goes back to "blank", how would I add the 3 lines to make the last click go back to "blank"?

Private Sub Toggle(cel As Range)
     Application.ScreenUpdating = False
     
     Select Case cel.Value
        Case "P" ' It's a checkmark so change to !
            cel.Font.Name = "Calibri"
            cel = "?"
        Case "?" ' it's an ? so change it to X
            cel.Font.Name = "Wingdings 2"
            cel = "O"
        Case "O" ' It's an X so change it to a checkmark
            cel.Font.Name = "Wingdings 2"
            cel = "P" ' This is a checkmark in the Wingding 2's font
        Case Else
            If cel.Value = "" Then
                cel.Font.Name = "Wingdings 2"
                cel = "P" ' This is a checkmark in the Wingding 2's font
            End If
    End Select
    Application.ScreenUpdating = True

End Sub

Thank you!

B.
0
Martin LissOlder than dirtCommented:
Private Sub Toggle(cel As Range)
     Application.ScreenUpdating = False
    
     Select Case cel.Value
        Case "P" ' It's a checkmark so change to ?
            cel.Font.Name = "Calibri"
            cel = "?"
        Case "?" ' it's an ? so change it to X
            cel.Font.Name = "Wingdings 2"
            cel = "O"
        Case "O" ' It's an X so change it to a blank
            cel = ""
        Case "" ' It's blank so change it to a checkmark
            cel.Font.Name = "Wingdings 2"
            cel = "P" ' This is a checkmark in the Wingding 2's font
    End Select
    Application.ScreenUpdating = True

End Sub

Open in new window

0
Martin LissOlder than dirtCommented:
In case you didn't catch it I updated the above to remove the "Case Else" since it's now redundant.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.