0
Thanks

A few words of thanks would be greatly appreciated.

Excel - Click a cell and insert a wingding




In excel I am wanting to be able to click a cell to insert a Selected wingding from a list.
But to also beable to click the cell a second time to change to another wingding.
I am trying to create a Tick and cross function for a Checklist. Click once to input a tick click twice input a cross click thrice and cell is cleared.
I have seen this tht was used to change the color of the cell on click and am having trouble working out if I can modify it or need something completely different.


Private Sub Worksheet_SelectionChange(ByVal Target As Range) 

With Target 
If Intersect(.Cells, Columns(2)) Is Nothing Or .Count > 1 Then Exit Sub 
Select Case .Value 
Case "" 
.Interior.ColorIndex = 10 
Case 1 
.Interior.ColorIndex = 6 
Case 2 
.Interior.ColorIndex = 2 
Case 3 
.Interior.ColorIndex = xlNone 
.Value = vbNullString 
Exit Sub 
Case Else 
Exit Sub 
End Select 
.Value = .Value + 1 
End With 

End Sub 

You are on the right path


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    With Target
        If Intersect(.Cells, Columns(2)) Is Nothing Or .Count > 1 Then Exit Sub
        
            Selection.Font.Name = "Wingdings"
        
            Select Case .Value
            
                'if blank,then put checkmark
                Case ""
                    .Value = "û" ' checkmark character in wingding
                
                'if checkmark, then put cross
                Case Is = "û"
                    .Value = "ü" ' cross mark character in wingding
                
                'if cross, then clear
                Case Is = "û"
                    .Value = ""
                
                'default
                Case Else
                    
                    .Value = ""
            
            End Select

    End With

Thanks to rizvisa1 for this tip on the forum.
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Excel - Click a cell and insert a wingding », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!