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