Checkmark Function - Tweaking

T

Tom

I use the "checkmark" function in Excel which enables me to right-click on a
cell
and but a "beautiful" checkmark into the cell.

The function uses the "Wingdings" font and character ASCII character "252"
to create the checkmark.

I want to import the spreadsheet data into an Access db. The data in the
column that allows me to use the checkmark function should be translated in
boolean value (yes or no; true or false).

Currently, the character 252 equals the "ü" (font = Verdana). Rather than
importing that "ü", I'd rather import a "Y" (character 89). However, in
Wingdings font, the symbol definitely useful for the "checkmark idea".

Does anyone have a good idea as to how to best approach it??? Get the nice
looking checkmark but have a "Y" stored the cell.

Thanks,
Tom



*****************************
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)

If Target.Column <> 2 And Target.Column <> 5 Then Exit Sub
If Intersect(Target, Me.Range("b:n")) Is Nothing Then Exit Sub
If Intersect(Target, Me.Range("B:B")) Is Nothing And Intersect(Target,
Me.Range("N:N")) Is Nothing Then Exit Sub

On Error GoTo errHandler:
Application.EnableEvents = False
If IsEmpty(Target) Then
Target.Formula = "=char(252)"
Target.Font.Name = "Wingdings"
Else
Target.ClearContents
End If

Cancel = True

errHandler:
Application.EnableEvents = True

End Sub

************************************
 
E

Earl Kiosterud

Tom,

How about =IF(CODE(A2)=252, "Y","N") in a helper column? Use that column
for the Access import, and ignore the original. It might be better to set
this up the other way around: Put Y or N in a column (formatted for white
for invisibility), and have a display column with
=IF(A3="Y",CHAR(252),"") using Windings. Or Excel checkboxes.
 
T

Tom

Earl:

Using the "helper column" is a great idea... that works great for me.

I had to make a minor modification since "unchecking" the cell (empty cell)
would throw an error. Now, it shows "True" or "False" ... which can be
imported as boolean into Access. Again, thanks for the info!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top