给你写了一个宏,粘贴到宏编辑器中,运行一下就好了Sub Macro1() For i = 1 To UsedRange.Rows.Count If InStr(Cells(i, 2), "小计") > 0 Then Range("A" + CStr(i) + ":F" + CStr(i)).Select With Selection.Interior .ColorIndex = 43 .Pattern = xlSolid End With End If Next iEnd Sub