Drop down list - Display Yes/No but returns "tick"/"cross" symbols

dmacmillan

Board Regular
Joined
Apr 5, 2004
Messages
125
Hello All,

Seeking assistance with drop down lists with symbols.

I require a drop down list that displays Yes/No but returns a "tick" or "cross".

Is there Custom text formatting equivalent of [=1]"Yes";[=0]"No" using Wingdings to present symbols. For example, [=P]"Yes";[=O]"No" .... I cannot get this to work.

Many thanks,
David
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Assuming that your dropdown boxes are in cells in column B (amend code to match your data)
yes no.jpg

Place in sheet code window (right click on sheet tab \ view code \ paste code into that window)
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Not Intersect(Target, Range("B2:B" & Rows.Count)) Is Nothing Then
        Application.EnableEvents = False
        Select Case LCase(Target)
        Case "yes":     Target = Evaluate("Unichar(10004)")
        Case "no":      Target = Evaluate("Unichar(10006)")
        End Select
        Application.EnableEvents = True
    End If
End Sub
 
Upvote 0
Assuming that your dropdown boxes are in cells in column B (amend code to match your data)
View attachment 22981
Place in sheet code window (right click on sheet tab \ view code \ paste code into that window)
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Not Intersect(Target, Range("B2:B" & Rows.Count)) Is Nothing Then
        Application.EnableEvents = False
        Select Case LCase(Target)
        Case "yes":     Target = Evaluate("Unichar(10004)")
        Case "no":      Target = Evaluate("Unichar(10006)")
        End Select
        Application.EnableEvents = True
    End If
End Sub

Thank you Yongle!

I had hoped to avoid VBA - because of the audience/users - but suspected unavoidable.

Kind regards,
David
 
Upvote 0
Another suggestion which avoids VBA
1 and 0 in dropdown (insted of yes & no)
and use conditional formatting with icons as below

one zero.jpg

icon sets.jpg
 
Upvote 0
Another suggestion which avoids VBA
1 and 0 in dropdown (insted of yes & no)
and use conditional formatting with icons as below

View attachment 22984
View attachment 22985
Thanks again Jongle!

The wee issue for this solution is the "0,1" interface in the drop-down list.

Oh, a query on the VBA solution ... must the Cases be written in lower case (i.e. "yes" not "Yes")?

Kind regards,
David
 
Upvote 0
You can do it with CF. First set the cell's regular number format to:
;;;"P"
which will handle the Yes values. Then add a conditional format rule to set the number format to:
;;;"O"
when its value is No. Then change the font, and job done.
 
Upvote 0
Why did you change it?
- it was written to accept every form of yes

To restrict to "Yes" and "No"...

Rich (BB code):
Select Case Target
Case "Yes": Target = Evaluate("Unichar(10004)")
Case "No": Target = Evaluate("Unichar(10006)")
End Select

I am guessing that the code failed because you gave VBA a headache!
- LCase(Target) cannot be"Yes"
 
Upvote 0
Why did you change it?
- it was written to accept every form of yes

To restrict to "Yes" and "No"...

Rich (BB code):
Select Case Target
Case "Yes": Target = Evaluate("Unichar(10004)")
Case "No": Target = Evaluate("Unichar(10006)")
End Select

I am guessing that the code failed because you gave VBA a headache!
- LCase(Target) cannot be"Yes"

Marvellous, thank you Yongle.

Education is a journey; I wouldn't be across this issue had I not 'tweaked' the code.

With thanks,
David
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top