|
本帖最后由 qh8600 于 2015-5-2 14:07 编辑
- Sub demo()
- Dim a, j, b, i, s
- a = Cells(1, Columns.Count).End(1).Column
- For j = 2 To a Step 4
- b = Cells(Rows.Count, j).End(3).Row
- For i = 1 To b
- If Cells(i, j) = 0 Then x = Cells(i, j + 1)
- Next
- For i = 1 To b
- If Cells(i, j + 1) = x Then
- If IsEmpty(s) Then
- Set s = Cells(i, j + 1)
- Else
- Set s = Union(s, Cells(i, j + 1))
- End If
- End If
- Next
- Next
- Cells.Interior.ColorIndex = xlNone
- s.Interior.ColorIndex = 6
- End Sub
复制代码 附件楼下
|
|