问题描述
我有一个特殊的列,在特殊字符的多行中有多次出现.这是响应"字符.它是一个带有斜线的大写R.它表示为Unistring 211F.它也可以在HTML中表示为℟.
I have a particular column that has multiple occurrences in multiple rows of a special character. It's the "Response" character. It's a capital R with a slash through it. It's represented as Unistring 211F. It can also be represented in HTML as ℟.
我想使用VBA搜索响应"字符,并将其替换为响应"和换行ASC(10).
I'd like to use VBA to search for the "Response" character and replace it with "Response" and the line feed ASC(10).
如何搜索和替换此特殊字符?
How can I search and replace this special character?
推荐答案
您将要搜索 what:= ChrW(8479)
,并替换为 replacement:="Replace"&Chr(10)
.
You will want to search for what:=ChrW(8479)
and replace with replacement:="Replace" & Chr(10)
.
此快速代码将使您在活动的工作表中替换从Unichar到Text的文本.
This quick code will make your Unichar-to-Text replacement across the active worksheet.
Sub replace_Response()
Dim fnd As Range
With ActiveSheet
.Cells.Replace what:=ChrW(8479), replacement:="Response" & Chr(10), lookat:=xlPart
End With
End Sub
可以将替换范围缩小为一列,一行或任何选定的单元格组.
The range of replacements can be pared down to a column, row or any selected group of cells.
这篇关于查找并替换特殊的Unicode字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!