|
发表于 2017-8-18 21:59
|
显示全部楼层
本楼为最佳答案
- Sub a()
- Dim sInt, Str, i%, r%
- Cells.Interior.ColorIndex = 0
- sInt = Application.InputBox(Prompt:="请输入需要查询的内容")
- If Len(Trim(sInt)) > 0 Then
- Str = sInt
- Else
- MsgBox Prompt:="没有输入有效的内容"
- Exit Sub
- End If
- r = Cells(Rows.Count, 2).End(3).Row
- For i = 1 To r
- If InStr(Cells(i, 2), Str) Then
- Cells(i, 1).Resize(1, 6).Interior.ColorIndex = 6
- End If
- Next
- End Sub
复制代码 |
|