If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > ADD a special character

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-30-07, 09:43
starkmann starkmann is offline
Registered User
 
Join Date: Feb 2007
Posts: 348
ADD a special character

Hello all,
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?
Reply With Quote
  #2 (permalink)  
Old 10-30-07, 15:52
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Howdy. Can you record the macro and the steps you are using? Does anything show up?
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 10-31-07, 09:25
starkmann starkmann is offline
Registered User
 
Join Date: Feb 2007
Posts: 348
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.

Any thoughts or suggestions?
Reply With Quote
  #4 (permalink)  
Old 10-31-07, 13:35
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
On my Win XP, with Symbol, the PSI character is 89.

This code will insert the value:

Code:
Sub LetterPSI()
    ActiveCell.FormulaR1C1 = "Y"
    ActiveCell.Font.Name = "Symbol"
End Sub
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!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #5 (permalink)  
Old 10-31-07, 13:43
starkmann starkmann is offline
Registered User
 
Join Date: Feb 2007
Posts: 348
That works like a dream. Thanks very much.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On