excel vba 删除指定字符
发布网友
发布时间:2022-10-30 17:47
我来回答
共2个回答
热心网友
时间:2023-10-12 06:22
Sub 删除字符()
arr = [c2:h20]
Set regex = CreateObject("VBScript.RegExp")
regex.Global = True
regex.Pattern = "[,。@#$%&]+"
For i = 1 To UBound(arr)
For j = 1 To UBound(arr, 2)
arr(i, j) = regex.Replace(arr(i, j), "/")
Next
Next
[c2:h20] = arr
End Sub
热心网友
时间:2023-10-12 06:22
Sub Macro1()
'
' Macro1 Macro
' 宏由 yzvvj 录制,时间: 2015-4-23
'
'
Range("C2:H20").Select
Selection.Replace What:=",", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="。", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub