在VBA Excel中,打印" & Chr(34) & "是用来定义的"。我搜索过,"根据这个网站,它说第 34 个字符是。
以同样的方式竖起大拇指签名,代码是
👍 👍
Run Code Online (Sandbox Code Playgroud)
我努力了:
" & Chr(#128077) & "
" & Chr(128077) & "
" & Chr(#x1f44d) & "
" & Chr(x1f44d) & "
Run Code Online (Sandbox Code Playgroud)
但它说错误为语法错误或期望)或无效参数
谁能给我建议解决方案
在 Excel 中,字符使用 Unicode 存储UTF-16。“竖起大拇指”对应的Unicode字符U+1F44D,编码如下:
以 UTF-16(十六进制)表示:0xD83D 0xDC4D (d83ddc4d)
UTF-16(十进制):55357、56397
所有非经典拉丁字符 (ASCII) 的字符均应使用chrW和进行处理ascW。
所以,就你的情况而言
ChrW(55357) & ChrW(56397)
or
ChrW(&HD83D) & ChrW(&HDC4D)
Run Code Online (Sandbox Code Playgroud)
会竖起大拇指。另请注意,您不会在 VBA IDE 中获得该信息。您必须将其放入工作表中才能查看。
澄清
' Puts a thumbs up symbol in A1
ActiveSheet.Range("A1").Value = ChrW(55357) & ChrW(56397)
' Will not produce a thumbs up symbol, since VBA can't handle it
Debug.Print ChrW(55357) & ChrW(56397)
' Will not produce a thumbs up symbol, since VBA can't handle it
MsgBox ChrW(55357) & ChrW(56397)
Run Code Online (Sandbox Code Playgroud)
HTML
如果您希望点赞是 HTML 格式,请执行以下操作:
HtmlString = "<p>something something 👍</p>"
Print #1, HtmlString ' <-- replace with your output method
Run Code Online (Sandbox Code Playgroud)
(👍或者👍)
| 归档时间: |
|
| 查看次数: |
8578 次 |
| 最近记录: |