ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Special characters in shortcut menus (https://www.excelbanter.com/excel-programming/338868-special-characters-shortcut-menus.html)

XP

Special characters in shortcut menus
 
I am using Office 2003 on Windows XP.

Does anyone have or know where I can find a listing of special characters
that can appear in a shortcut menu (in the menu item text, not the icon) ?

I am presuming this would be a list of characters that may appear in the VBE
as the character itself, not a question mark? Or is there a way to make any
special character appear in a shortcut menu - such as delta - ? If so, how?

Thanks much for your assistance.

Doug Glancy

Special characters in shortcut menus
 
XP,

This is kind of crude but seems to do the job. It creates a shortcut bar
and for the UniCode characters 1 to 65536 it attempts to make them the
caption of the shortcut bar. If setting the character as the caption
doesn't cause an error it prints the char in row i, column 1 of the active
spreadsheet - so make sure your activesheeet is blank when you run this.
Many of the chars don't error but are unprintable. This macro takes a while,
but it shows you what number char your up to in the status bar. (I found
the ChrW function which supports UniCode chars from 1 to 65536, but only on
a Windows machine. If you don't want UniCode chars then just use the Chr
function, and change the upper limit of the for loop to 255.)

Sub test()
Dim cbar As CommandBar
Dim cbarbutton As CommandBarButton
Dim i As Long

Application.ScreenUpdating = False
Set cbar = CommandBars.Add()
With cbar
.Visible = True
.Enabled = True
End With

Set cbarbutton = cbar.Controls.Add
With cbarbutton
.Style = msoButtonIconAndCaption
For i = 1 To 65536
If i Mod 100 = 0 Then
Application.StatusBar = i
End If
On Error Resume Next
.Caption = ChrW(i)
If Err = 0 Then
ActiveSheet.Cells(i, 1) = .Caption
End If
On Error GoTo 0
Next i
End With
Application.StatusBar = False
cbar.Delete
Application.ScreenUpdating = True
End Sub

--
hth,

Doug

"XP" wrote in message
...
I am using Office 2003 on Windows XP.

Does anyone have or know where I can find a listing of special characters
that can appear in a shortcut menu (in the menu item text, not the icon) ?

I am presuming this would be a list of characters that may appear in the
VBE
as the character itself, not a question mark? Or is there a way to make
any
special character appear in a shortcut menu - such as delta - ? If so,
how?

Thanks much for your assistance.




XP

Special characters in shortcut menus
 
Thanks much Doug!

"Doug Glancy" wrote:

XP,

This is kind of crude but seems to do the job. It creates a shortcut bar
and for the UniCode characters 1 to 65536 it attempts to make them the
caption of the shortcut bar. If setting the character as the caption
doesn't cause an error it prints the char in row i, column 1 of the active
spreadsheet - so make sure your activesheeet is blank when you run this.
Many of the chars don't error but are unprintable. This macro takes a while,
but it shows you what number char your up to in the status bar. (I found
the ChrW function which supports UniCode chars from 1 to 65536, but only on
a Windows machine. If you don't want UniCode chars then just use the Chr
function, and change the upper limit of the for loop to 255.)

Sub test()
Dim cbar As CommandBar
Dim cbarbutton As CommandBarButton
Dim i As Long

Application.ScreenUpdating = False
Set cbar = CommandBars.Add()
With cbar
.Visible = True
.Enabled = True
End With

Set cbarbutton = cbar.Controls.Add
With cbarbutton
.Style = msoButtonIconAndCaption
For i = 1 To 65536
If i Mod 100 = 0 Then
Application.StatusBar = i
End If
On Error Resume Next
.Caption = ChrW(i)
If Err = 0 Then
ActiveSheet.Cells(i, 1) = .Caption
End If
On Error GoTo 0
Next i
End With
Application.StatusBar = False
cbar.Delete
Application.ScreenUpdating = True
End Sub

--
hth,

Doug

"XP" wrote in message
...
I am using Office 2003 on Windows XP.

Does anyone have or know where I can find a listing of special characters
that can appear in a shortcut menu (in the menu item text, not the icon) ?

I am presuming this would be a list of characters that may appear in the
VBE
as the character itself, not a question mark? Or is there a way to make
any
special character appear in a shortcut menu - such as delta - ? If so,
how?

Thanks much for your assistance.





Doug Glancy

Special characters in shortcut menus
 
XP,

You're welcome.

One change. The commandbars.add line should be:

Set cbarbutton = cbar.Controls.Add(temporary:=True)

Without the "Temporary := True" you'll end up with one Custom toolbar for
each time you run it. You can delete them in the Customize -- Toolbars
dialog.

Doug

"XP" wrote in message
...
Thanks much Doug!

"Doug Glancy" wrote:

XP,

This is kind of crude but seems to do the job. It creates a shortcut bar
and for the UniCode characters 1 to 65536 it attempts to make them the
caption of the shortcut bar. If setting the character as the caption
doesn't cause an error it prints the char in row i, column 1 of the
active
spreadsheet - so make sure your activesheeet is blank when you run this.
Many of the chars don't error but are unprintable. This macro takes a
while,
but it shows you what number char your up to in the status bar. (I found
the ChrW function which supports UniCode chars from 1 to 65536, but only
on
a Windows machine. If you don't want UniCode chars then just use the Chr
function, and change the upper limit of the for loop to 255.)

Sub test()
Dim cbar As CommandBar
Dim cbarbutton As CommandBarButton
Dim i As Long

Application.ScreenUpdating = False
Set cbar = CommandBars.Add()
With cbar
.Visible = True
.Enabled = True
End With

Set cbarbutton = cbar.Controls.Add
With cbarbutton
.Style = msoButtonIconAndCaption
For i = 1 To 65536
If i Mod 100 = 0 Then
Application.StatusBar = i
End If
On Error Resume Next
.Caption = ChrW(i)
If Err = 0 Then
ActiveSheet.Cells(i, 1) = .Caption
End If
On Error GoTo 0
Next i
End With
Application.StatusBar = False
cbar.Delete
Application.ScreenUpdating = True
End Sub

--
hth,

Doug

"XP" wrote in message
...
I am using Office 2003 on Windows XP.

Does anyone have or know where I can find a listing of special
characters
that can appear in a shortcut menu (in the menu item text, not the
icon) ?

I am presuming this would be a list of characters that may appear in
the
VBE
as the character itself, not a question mark? Or is there a way to make
any
special character appear in a shortcut menu - such as delta - ? If so,
how?

Thanks much for your assistance.








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

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