0
我被給了一段代碼,用於在Excel工作表中識別雙引號等。本代碼顯示消息框中雙引號的一個實例,我試圖讓它顯示所有實例。以下是我所得到的摘錄。我將.address添加到變量中以提供確切的地址,但僅顯示一個。我試圖重複希望顯示引用的多個實例的變量,但目前還沒有運氣。VBA在工作表中顯示錯誤字符的多個實例
Option Explicit
Sub BadCHARFinder()
'Finds any occurance of: Quotes (single or double, Underscore, Hyphen, Carot in the excel sheet
'Note: skips the header row when searching
'Find Double Quote (")
Dim foundDoubleQuote As Variant
Set foundDoubleQuote = ActiveSheet.Cells.Find("""", ActiveSheet.Cells(2, 1), xlValues, xlPart)
If (Not foundDoubleQuote Is Nothing) Then
'found
MsgBox "Found double quote at: " & foundDoubleQuote.Address, vbOKOnly, "foundDoubleQuote"
Else
'not found
End If
End Sub
你究竟在努力實現什麼 - 只是列出地址或刪除它們? – SJR