ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   assign a symbol to a shortcut key (https://www.excelbanter.com/excel-discussion-misc-queries/17102-assign-symbol-shortcut-key.html)

Martin Hennegriff

assign a symbol to a shortcut key
 
Does anybody know, how I may assign a symbol to a shortcut key in XL?
I'd like to insert the check mark symbol (Wingding character code 252) to a
key combination. Any suggestions are highly appreciated.

Greetings,



swatsp0p

Open the VBA editor (ALT+F11), find your desired workbook in the left pane.
Right click and select InsertModule. A new window opens on the right hand
pane. In this new window, place this code:

Sub checkmark1()
With Selection.Font
.Name = "Marlett"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveCell.FormulaR1C1 = "a"
End Sub

Close the VBA session (ALT+F4)

In your sheet, press ALT+F8. In the window that opens, find and highlight
the macro named 'checkmark1' and click Options. Assign your desired
keystroke to use to activate this macro (note: it must be a letter).

With the cell pointer in your desired cell, press ALT+(your selection) to
enter the 'checkmark'.

Note that I used the letter "a" in the Marlette font, as I couldn't find the
keystroke for WingDings. You may adjust the code above if you have that
information.

HTH




All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com