|
本帖最后由 wanao2008 于 2023-7-23 19:42 编辑
如果不区分数字与中文的话,得到的结果会有点乱,
代码如下:
- Sub byWanao()
- Dim rng As Range, i&, j&, k&, cRow&
- cRow = 144
- For k = 1 To 3
- Sheet1.Range("M" & cRow & ":AY" & cRow + 14).Interior.ColorIndex = xlNone
- Set rng = Sheet1.Range("M" & cRow & ":AY" & cRow + 14)
- For i = 1 To rng.Rows.Count
- For j = 1 To rng.Columns.Count - k
- If rng(i, j) = "对" And rng(i, j + k) = "对" Then
- rng(i, j).Interior.ColorIndex = 10
- rng(i, j + k).Interior.ColorIndex = 10
- End If
- Next
- Next
- cRow = cRow + 16
- Next
- End Sub
复制代码 |
|