什么是"%"的Chrw值?

时间:2017-07-14 06:24:51

标签: excel-vba vba excel

这是我的代码,用于查找列名称" Total Tech KBA%Completion"。

有人可以帮我识别%符号。

Set t = .Find("Total Tech KBA " & % & " Completion", lookat:=xlWhole)

2 个答案:

答案 0 :(得分:0)

以下代码适用于我:

Dim t As Range
Dim StrtoFind As String

StrtoFind = "Total Tech KBA % Completion"

With Worksheets("Sheet1").Cells
    Set t = .Find(what:=StrtoFind, lookat:=xlWhole)

    If Not t Is Nothing Then ' make sure Find was successful
        MsgBox StrtoFind & " found at column number " & t.Column
    End If
End With

答案 1 :(得分:0)

找到答案,谢谢Shai的快速支持。

来自unicode网站" https://unicode-table.com/en/#0025"

Set t = .Find("Total Tech KBA " & ChrW(37) & " Completion ", lookat:=xlWhole)

   If Not t Is Nothing Then

       Columns(t.Column).EntireColumn.Copy _
       Destination:=ThisWorkbook.Sheets(1).Range("B1")
   Else: MsgBox "Total Tech KBA " & ChrW(37) & " Completion is not found"
   End If
End With