Excel VBA

css navigation by Css3Menu.com

All the Special Characters

I had already built a macro to read all the fonts on my PC at work to make examples to prove that our barcode font does not handle some of the characters that are in the middle of part numbers.

I built this to build a list of many special characters in place of CharMap.exe.

The maximum character I can use is 65536. I know there are some characters in the range of 128,000 but haven't built for them.

Sub SpecialCharSheet()
    Dim LastRow     As LongPtr 'Required for 64-bit Excel
    Dim X           As LongPtr
    Dim Y           As LongPtr
    Dim UpRan       As String

    Sheets("Extended").Select
    Cells.Select	'Select it all
    Selection.ClearContents
    UpRan = InputBox("What is the UPPER range of the numbers?", "Upper", 2500)
        Cells(1, 1) = "Hex"
        Cells(1, 1 + 1) = "Dec"
        Cells(1, 1 + 2) = "Char"
    LastRow = Range("A65000").End(xlUp).Row    ' 'LAST ROW

    Y = 1
    For X = 201 To UpRan
        LastRow = Range(Cells(5000, Y).Address).End(xlUp).Row + 1 
        Cells(LastRow, Y) = Application.Dec2Hex(X) ' Hexidecimal equiv of next col
        Cells(LastRow, Y + 1) = X
        Cells(LastRow, Y + 2) = ChrW$("&H" & Application.Dec2Hex(X))
 	' The actual character

         If X Mod 100 = 0 Then
            If X > 200 Then
            Y = Y + 3
            Cells(1, Y) = "Hex"	'Repeat headings in next col
            Cells(1, Y + 1) = "Dec"
            Cells(1, Y + 2) = "Char"
            Cells(1, Y).Select
            DoEvents
            End If
        End If
    Next X
End Sub

 

Did I need this thing, no. Mostly it was to prove to myself that I could write it.

© 2015-2017

Updated:  06/14/2017 17:53
This page added:  13 November 2015