Luk*_*uke 5 excel vba excel-formula
我有一些乱码(或者,不是乱码,但非英语字符,如带有斯堪的纳维亚口音的A等),我需要从大约80,000个条目中找出它们.
我可以编写一个公式来拾取并标记包含除其他任何内容之外的任何单元格
ABCDEFGHIJKLMNOPQRSTUVWXYZ?
以下对我有用:
Option Explicit
Sub NonAscii()
Dim UsedCells As Range, _
TestCell As Range, _
Position As Long, _
StrLen As Long, _
CharCode As Long
Set UsedCells = ActiveSheet.Range("A1:A4271").CurrentRegion
For Each TestCell In UsedCells
StrLen = Len(TestCell.Value)
For Position = 1 To StrLen
CharCode = Asc(Mid(TestCell, Position, 1))
If CharCode < 97 Or CharCode > 122 Then
TestCell.Interior.ColorIndex = 36
Exit For
End If
Next Position
Next TestCell
End Sub
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1907 次 |
| 最近记录: |