I've used VBA in Access but not much in Excel so please forgive my ignorance. I have a user that has a reason to use the greek letter Psi repeatedly in her excel spreadsheets. To get this letter I can type 03c8 then hit Alt+X. I can get it to show up in an excel cell this way. I would like to give her a toolbar button, per her request, she doesn't have to type all that and so I can give her a shortcut key. How in Excel can I insert this special character at the location of the cursor?
Sorry I haven't responded sooner. I wanted to get a chance to work on it some more.
So I can not get the character to show up in Excel. I can create it in word and paste it into excel and it stays. Then if I run the code function on it I get the number 63 returned to me. If I run the char function on 63 I get a question mark back. If I run both Char(Code(PsiCellHere)) then I get the question mark there as well.
So unless I write some kind of macro that grabs the psi from somewhere else and uses the clipboard, I'm not sure how to do it. I will contact my user to see if it is just one workbook or several that she is using this in.
Another option that I could pursue but would need a little direction on: I'm told that the capital Y in Symbols also results in a Psi. So if I wrote something to grab the current font, change to Symbols, type Y, then return the font, that may do it too.
On my Win XP, with Symbol, the PSI character is 89.
This code will insert the value:
ActiveCell.FormulaR1C1 = "Y"
ActiveCell.Font.Name = "Symbol"
Put it in the Personal Macro Workbook. Save it.
Then right-click the toolbars and choose Customize. In the middle tab, on the left choose Macro, on the right, click on "Custom menu item" and hold down as you drag to a toolbar (when you see the dark vertical line, release the mouse).
Then right click it and choose "Assign macro" and select this one. Right-click again and change name to something like PSI. Click OK.
old, slow, and confused
but at least I'm inconsistent!