PDA

View Full Version : Solved: Displaying symbols programmatically



muttleee
09-28-2006, 04:28 AM
Hiyas :hi:

I am trying to print a 'tick'/'check' symbol in a particular column of an Excel document if a condition is satisfied. How do I go about doing this programmatically? I think I must have to do something with the font and or charset or something but beyond that I'm clueless.

For regular I just use:

.Cells(row, col)= Value
Currently the only font settings etc are these:

xl.Cells.select
xl.selection.Font.Name = "Verdana"
xl.selection.Font.Size = 9
xl.Rows("1:1").Select
xl.Selection.Font.Bold = True
xl.selection.Font.size = 10
xl.selection.RowHeight = 15
xl.Cells.select
xl.selection.columnwidth = 100
xl.selection.columns.Autofit
xl.selection.rows.Autofit
xl.selection.VerticalAlignment = xlTop
xl.ActiveSheet.Range("A1").Select
What changes do I need to make to be able to print a tick/check to an Excel cell?

Thanks in advance. : pray2:

Charlize
09-28-2006, 04:50 AM
Hiyas :hi:

I am trying to print a 'tick'/'check' symbol in a particular column of an Excel document if a condition is satisfied. How do I go about doing this programmatically? I think I must have to do something with the font and or charset or something but beyond that I'm clueless.

For regular I just use:

.Cells(row, col)= Value
Currently the only font settings etc are these:

xl.Cells.select
xl.selection.Font.Name = "Verdana"
xl.selection.Font.Size = 9
xl.Rows("1:1").Select
xl.Selection.Font.Bold = True
xl.selection.Font.size = 10
xl.selection.RowHeight = 15
xl.Cells.select
xl.selection.columnwidth = 100
xl.selection.columns.Autofit
xl.selection.rows.Autofit
xl.selection.VerticalAlignment = xlTop
xl.ActiveSheet.Range("A1").Select
What changes do I need to make to be able to print a tick/check to an Excel cell?

Thanks in advance. : pray2:

Maybe you can use the Marlett font. When you put the letter a in the cel a V appears in the cel.

Look at this KB article http://www.vbaexpress.com/kb/getarticle.php?kb_id=550

Charlize

muttleee
10-02-2006, 06:24 AM
Thanks for the link - looks promising. :-)

Charlize
10-02-2006, 11:41 AM
Another way without Marlett font but with Symbol font. Use the squareroot symbol. Place this in the sheet module.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 1 And Target.Row > 1 Then
ActiveCell.Font.Name = "Symbol"
ActiveCell.Font.Size = 10
ActiveCell.FormulaR1C1 = "?"
Cancel = True
Else
MsgBox ("Only column 1 and row > 1")
Cancel = True
End If
End Sub

Charlize

Zack Barresse
10-03-2006, 12:56 PM
You could always show the character map programmatically as well..

http://vbaexpress.com/kb/getarticle.php?kb_id=784

HTH

Cyberdude
10-03-2006, 01:14 PM
I'm not sure I understand what you mean by a 'tick' mark, but I use 'check' marks a lot by entering an uppercase "P" and use the "Wingdings 2" font. Here's a little utility that I use. This utility requires that you click on the cell where you want the check mark, then execute the macro (which I do with a button):
Sub InsertCheckMark() '7/23/02
'Inserts a check mark into the selected cell
With ActiveCell
.Value = "P"
.VerticalAlignment = xlTop
.HorizontalAlignment = xlCenter
.Interior.ColorIndex = White
With .Font
.Name = "WingDings 2"
.ColorIndex = Black
.Size = 12
.Bold = False
End With
End With
End Sub Try it . . . you'll like it!

muttleee
10-10-2006, 03:58 AM
Thanks for all the help - I've got it working ok now. I used the Marlett font to write the letter 'a' to the document and that showed up as a 'tick' (or check mark for the Americans out there). :)

Must have a look at the Wing Ding thing for curiosity's sake...