Excel之Char.Chr.Chrw函数的使用范围及实例
时间:2023-06-04 09:19:19
Char、Chr、Chrw三个函数的功能:三个函数均以字符代码为参数,返回与代码相对应的字符。
一、Char函数可以在公式中使用
其中Char函数为工作表函数,可以在Excel公式中使用,可以返回ASCII码所对应的字符,参数范围为1~255,例如Char(65)="A"。当参数大于255时返回错误值#VALUE!
二、Chr、Chrw函数只能在VBA中使用
①Chr函数为VBA中的函数,返回与ANSI 字符代码相对应的字符。
当参数范围为0~255时,返回ASCII码所对应的字符,例如使用代码 Range("A1")=Chr(65)可以在A1单元格中显示字符“A”。
当参数位于[-32768,-1] 或 [256,65535]区间时,函数返回当前字符集中非Unicode的对应字符,例如使用代码 Range("A1") = Chr(33119)可以在A1单元格中显示字符“?_”。
②Chrw函数也是VBA中的函数,返回与ANSI 字符代码相对应的字符。
当参数范围为0~255时,返回ASCII码所对应的字符,与Chr函数相同,例如使用代码
Range("A1")=Chrw(65)
可以在A1单元格中显示字符“A”。当参数位于[-32768,-1] 或 [256,65535]区间时,函数返回当前字符集中Unicode的对应字符,例如使用代码 Range("A1") = Chrw(33119)可以在A1单元格中显示字符“?”。
标签:Excel之Char.Chr.Chrw函数的使用范围及实例
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Excel表格怎么选定区域打印?Excel打印选定区域的方法
2023-03-13 23:34:12
![](https://img.aspxhome.com/file/2023/7/a329901_0s.jpg)
activex控件启用了还是禁用怎么办
2023-05-02 19:10:40
![](https://img.aspxhome.com/file/2023/29/a262210_0s.jpg)
wps文字技巧如何设置标题样式
2022-12-07 18:57:59
SEARCH、SEARCHB 函数
2023-01-04 21:15:40
Win10电脑提示未设置TLS安全设置怎么办?
2023-01-27 16:04:45
![](https://img.aspxhome.com/file/2023/25/a218587_0s.jpg)
PPT如何绘制设计月牙形环形图 PPT绘制设计月牙形环形图实例教程
2022-12-28 05:12:27
![](https://img.aspxhome.com/file/2023/10/a352557_0s.jpg)
PPT如何制作小清新封面字体?PPT制作小清新封面字体的方法
2022-10-30 14:09:00
![](https://img.aspxhome.com/file/2023/10/a350173_0s.jpg)
ppt2010怎么制作拼图形状的图形?
2023-11-18 04:23:07
![](https://img.aspxhome.com/file/2023/10/a346165_0s.png)
Win10格式化只剩NTFS/REFS彻底封杀exFAT/FAT32磁盘
2023-11-21 12:38:04
![](https://img.aspxhome.com/file/2023/28/a241962_0s.jpg)
Win10 1909系统怎样显示鼠标指针轨迹?Win10 1909显示鼠标指针轨迹教程
2023-11-10 12:57:36
![](https://img.aspxhome.com/file/2023/4/48764_0s.jpg)
Win10系统禁用Snap窗口分屏功能的解决方法
2023-06-24 20:39:46
![](https://img.aspxhome.com/file/2023/3/a296168_0s.jpg)
达芬奇调色软件怎么设置中文?修改显示语言大放送
2022-05-19 00:48:47
![](https://img.aspxhome.com/file/2023/7/a332120_0s.jpg)
excel 制作一个数据透视表,并对其进行差异分析
2022-09-30 09:59:42
![](https://img.aspxhome.com/file/2023/1/a155271_0s.gif)
Win10系统安装字体后Edge浏览器打开网页出现乱码的原因及解决方法
2022-03-14 07:41:01
![](https://img.aspxhome.com/file/2023/28/a244469_0s.jpg)
Win10电脑键盘打不出字怎么办?
2023-11-18 19:06:58
![](https://img.aspxhome.com/file/2023/1/49821_0s.jpg)
Win11怎么关闭系统自动更新?
2023-09-12 23:33:54
![](https://img.aspxhome.com/file/2023/27/a234926_0s.png)
Wps如何调整表格打印区域的大小?Wps调整表格打印区域的大小方法
2022-12-20 00:53:43
![](https://img.aspxhome.com/file/2023/1/a182361_0s.gif)
如何取消爱奇艺自动更新?禁止爱奇艺自动更新的方法
2022-06-01 15:53:06
![](https://img.aspxhome.com/file/2023/8/a339515_0s.jpg)
电脑主板电池没电了怎么解决?
2023-02-08 08:54:50
![](https://img.aspxhome.com/file/2023/4/a305952_0s.jpg)
电脑版wps文档如何将脚注的编号添加上方括号
2022-08-05 10:22:29
![](https://img.aspxhome.com/file/2023/7/a182947_0s.png)