# CODE Function

> Return the Windows-1252 code of the first character of a text with the CODE formula function of TX Sheet Control: examples, code 63 and the #VALUE! error.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > CODE Function
- **225 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/code/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/code/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/code/llms-full.txt

---

Return the numeric code of the first character of a text. The code is that of the Windows-1252 character set, as in Excel on Windows: "A" returns 65, "é" 233 and "€" 128. A character outside that character set returns 63, the code of the question mark, and empty text returns `#VALUE!`. Use [UNICODE](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/unicode/llms-full.txt) for the Unicode code point of a character.

### Syntax

```text
CODE(text)
```

Category: Text. Minimum arguments: 1. Maximum arguments: 1.

Available for supported offline calculation.

### Examples

```text
=CODE("😀")
```

The formula returns 63, because the emoji is not part of the Windows-1252 character set.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [CLEAN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/clean/llms-full.txt)
- **Next:** [COLUMN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/column/llms-full.txt)
