Excel 怎么用VBA代码快速查找替换指定字符

strSearch 是被查找的内容
strReplace 是替换的内容

Sub FindAndReplace(ByVal strSearch As String, ByVal strReplace As String)

    Cells.Replace What:=strSearch, Replacement:=strReplace, LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
        
End Sub

Sub main()
     Call FindAndReplace("abcd", "ww")
End Sub

  

上一篇:linux常用命令


下一篇:PowerPoint Application事件