Returns the Unicode character that is referenced by the given numeric value. Supports full Unicode character set (beyond ASCII). Essential for working with international characters, emojis, and extended character sets in Excel.
Master the fundamentals of Excel UNICHAR function
The UNICHAR function converts Unicode character codes (1-1114111) to their corresponding characters. It extends beyond CHAR function by supporting the full Unicode character set, including emojis, international characters, mathematical symbols, and special characters. Essential for modern text processing and internationalization.
Supports Unicode range 1-1114111
Can generate emojis and symbols
Supports all international characters
Beyond ASCII range of CHAR
Function-specific parameters
Function-specific return type
Generate emojis from Unicode codes
Work with international characters
Generate mathematical and special symbols
Map Unicode codes to characters
Exact matching required
Returns numeric position
Handles missing text gracefully
=UNICHAR(number)The Unicode number of the character. Must be between 1 and 1114111.
Unicode character
Description: Returns the Unicode character referenced by the numeric value (supports full Unicode range)
Convert Unicode code to character
Unicode 65 corresponds to uppercase letter 'A' (same as ASCII)
Simple VBA implementation of UNICHAR function
' Basic UNICHAR in VBA
Range("B1").Value = Application.WorksheetFunction.Unichar(65)
' Returns: "A"
' Using VBA Unichar function
Dim unicodeCode As Long
unicodeCode = 128512
Range("B2").Value = Application.WorksheetFunction.Unichar(unicodeCode)
' Returns: π
' Generate emojis
Sub GenerateEmojis()
Range("A1").Value = Application.WorksheetFunction.Unichar(128512) ' π
Range("A2").Value = Application.WorksheetFunction.Unichar(128513) ' π
Range("A3").Value = Application.WorksheetFunction.Unichar(128514) ' π
End Sub
' Generate international characters
Sub GenerateInternationalChars()
Range("A1").Value = Application.WorksheetFunction.Unichar(8364) ' β¬
Range("A2").Value = Application.WorksheetFunction.Unichar(165) ' Β₯
Range("A3").Value = Application.WorksheetFunction.Unichar(163) ' Β£
End SubGenerate ranges of Unicode characters
' Function to get Unicode character safely
Function GetUnichar(code As Long) As String
On Error Resume Next
If code >= 1 And code <= 1114111 Then
GetUnichar = Application.WorksheetFunction.Unichar(code)
Else
GetUnichar = "#VALUE!"
End If
On Error GoTo 0
End Function
' Generate emoji range
Sub GenerateEmojiRange()
Dim i As Long
Dim startCode As Long
Dim endCode As Long
startCode = 128512 ' First emoji
endCode = 128590 ' Last emoji in common range
Dim row As Integer
row = 1
For i = startCode To endCode
Range("A" & row).Value = Application.WorksheetFunction.Unichar(i)
row = row + 1
Next i
End Sub
' Convert Unicode code list to characters
Sub ConvertUnicodeList()
Dim codes() As Variant
codes = Array(65, 66, 67, 8364, 128512)
Dim i As Integer
For i = 0 To UBound(codes)
Range("A" & (i + 1)).Value = Application.WorksheetFunction.Unichar(codes(i))
Next i
End SubGenerate emojis from Unicode codes
Work with international characters
Generate mathematical symbols
Map Unicode codes to characters
UNICHAR returns #VALUE! when number is out of range
=IF(AND(A1>=1, A1<=1114111), UNICHAR(A1), "#VALUE!")Solution: Ensure number is between 1 and 1114111. Use IF to validate: =IF(AND(number>=1, number<=1114111), UNICHAR(number), "#VALUE!")
Unicode character may not display if font doesn't support it
=UNICHAR(128512)Solution: Ensure font supports the Unicode character. Some characters require specific fonts or Unicode-compatible fonts.
Some Unicode codes are reserved or invalid
=UNICHAR(code)Solution: Not all codes in range 1-1114111 are valid characters. Some are control characters or unassigned.
UNICHAR requires Excel 2013 or later
=CHAR(A1) for older versionsSolution: Use CHAR for older Excel versions, or upgrade to Excel 2013+. CHAR only supports 1-255.