Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro 1

Status
Not open for further replies.

jfussell

Technical User
Jul 17, 2001
66
US
Hi everyone, any help on this issue would be greatly appreciated. I used to use the CharMap a lot working on a traditional keyboard, however now I'm working on a laptop, and the usual keycode doesn't seem to apply. I'm working in an excel document, and I'd like to add the wingding character that looks like a checkmark to be a macro, so that I can use it on a continuous basis on all worksheets. I want to be able to type Ctrl Alt C and have the checkmark inserted into my document. Please let me know what code I would have to use in visual basic for this to happen. Thank you!
 
Will this do what you want?

With Selection.Font
.Name = "Wingdings"
.FontStyle = "Regular"
.Size = 10
End With
ActiveCell.FormulaR1C1 = "=CHAR(252)"
 
I tried inserting your text into VB, also I was only able to use the keyboard shortcut of Ctrl T and this is what ended up, but still won't work.

Sub CheckMark()
With Selection.Font
.Name = "Wingdings"
.FontStyle = "Regular"
.Size = 10
End With
ActiveCell.FormulaR1C1 = "=CHAR(252)"

Keyboard Shortcut: Ctrl t
End Sub

Any ideas?
 
Easy way is to be on a blank cell, do a Tools/Macros/Record a Macro.

Once started, just click on format cell, choose wingdings, then type =char(252) in the cell and stop the macro.

Blue
 
Thank you so much. I can't believe I didn't just go about it the easy route.
 
You can display charmap with:
[tt]Sub InsertChars()
Application.CommandBars("Worksheet menu bar").FindControl(, 308, , , True).Execute
End Sub[/tt]
Next, you can assign a shortcut Tools>Macros.. and select Options.
The disadvantage is that you have to format cell to wingdings next.
However, you should be able to customize the menu and find the control in "Insert" group of commands.

combo
 
But, to display dialog via macro, its button should be in the menu [lol].
So first add it manualy or by:
Sub InsertCharControl()
Set pmb = Application.CommandBars("worksheet menu bar").Controls(4)
pmb.Controls.Add Type:=msoControlButton, ID:=308, Before:=6, Temporary:=False
End Sub

combo
 
Hi all. Can anyone help with this. I want to update my Access database using input from Excel
 
Hi all. Can anyone help with this. I want to update my Access database using input from Excel

PharaohSeti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top