Dealing with specia characters, symbols and fonts in vba.

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I have been doing some reading for a while now, trying to figure out a way to get special characters display in a message box alert but I couldn't do that.

Now I have a few questions:
1. Can a message box display those characters? - for example I tried this code:

Code:
    Sub getsymbol ()
      MsgBox chr(34)
   End Sub

From the symbol list, the code 34 is for a pair of scissors (wingdings font).

2. If message box can't do that job, can it be displayed on controls such as labels ?

3. Do I have to specify the fonts and if yes, how do I do that?

Thanks in advance.
Kelly
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I believe the font for a MessageBox is controlled by Windows. I think you can change it, but it would become universal for all Window programs so I don't think it is a good idea to mess with it. On top of that, all text in a MessageBox must be the same so you cannot have normal text mixed with Wingding text... this same restriction applies to TextBoxes and Labels in Excel as well.
 
Upvote 0
Here is some code that you can run separately, Debug window has a maximum amount it can display. :( So it will take two different runs.

VBA Code:
Sub ChrTest()
'
    For I = 1 To 128
        Debug.Print "Chr(" & I & ") = " & Chr(I)
    Next
'
'    For J = 129 To 255
'        Debug.Print "Chr(" & I & ") = " & Chr(I)
'    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top