ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Special keystrokes in a Macro (https://www.excelbanter.com/excel-discussion-misc-queries/26455-special-keystrokes-macro.html)

Eric

Special keystrokes in a Macro
 
When ALT + 0176 is pressed you get the degree symbol. Likewise you get the
sigma character when you press ALT + 997. I would like to incorporate these
type of keystrokes into a macro. Is it possible, and if so, how? Thank you
in advance for your time and effort.

Eric Pearce



papou

Hello Eric
Look for Chr() function in VBA help.

HTH

Cordially
Pascal

"Eric" a écrit dans le message de news:
...
When ALT + 0176 is pressed you get the degree symbol. Likewise you get
the
sigma character when you press ALT + 997. I would like to incorporate
these
type of keystrokes into a macro. Is it possible, and if so, how? Thank
you
in advance for your time and effort.

Eric Pearce





Eric

That works for ASCII characters, but I need to access unicode characters as
obtained by use the keystrokes like ALT+0176 = 'degree symbol', and ALT+997
= 'sigma', etc... Chr() errors at anything above 255. Is there another
way?


"papou" wrote in message
...
Hello Eric
Look for Chr() function in VBA help.

HTH

Cordially
Pascal

"Eric" a écrit dans le message de news:
...
When ALT + 0176 is pressed you get the degree symbol. Likewise you get
the
sigma character when you press ALT + 997. I would like to incorporate
these
type of keystrokes into a macro. Is it possible, and if so, how? Thank
you
in advance for your time and effort.

Eric Pearce







Gord Dibben

Eric

Example code using Chr

Sub sq_Meters()
Selection.NumberFormat = "0"" m" & Chr(178) & """"
'0179 for cubic meters
End Sub


Gord Dibben Excel MVP

On Tue, 17 May 2005 08:39:31 -0600, "Eric"
wrote:

When ALT + 0176 is pressed you get the degree symbol. Likewise you get the
sigma character when you press ALT + 997. I would like to incorporate these
type of keystrokes into a macro. Is it possible, and if so, how? Thank you
in advance for your time and effort.

Eric Pearce



Eric

Apparently I am not explaining myself very well. If I were to press and
hold the ALT key and while holding down the ALT key were to press the number
sequence 997 then release the ALT key the greek symbol sigma will apear in
the current font. However, the Chr() function doesn't recognize anything
above 255. Therefore, I can't access any of the greek symbols which reside
in the numbers above 255. I really do understand the Chr() function and it
will not work for what I am trying to do. I really do appreciate the
suggestions to date, but they don't work. Is there anyone out there that
can help? Thanks in again, and in advance.

Eric


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Eric

Example code using Chr

Sub sq_Meters()
Selection.NumberFormat = "0"" m" & Chr(178) & """"
'0179 for cubic meters
End Sub


Gord Dibben Excel MVP

On Tue, 17 May 2005 08:39:31 -0600, "Eric"
wrote:

When ALT + 0176 is pressed you get the degree symbol. Likewise you get

the
sigma character when you press ALT + 997. I would like to incorporate

these
type of keystrokes into a macro. Is it possible, and if so, how? Thank

you
in advance for your time and effort.

Eric Pearce






All times are GMT +1. The time now is 06:49 AM.

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