- 帖子
- 6
- 主題
- 0
- 精華
- 0
- 積分
- 19
- 點名
- 0
- 作業系統
- windows xp
- 軟體版本
- office 2003
- 閱讀權限
- 10
- 性別
- 男
- 來自
- 台灣台中
- 註冊時間
- 2016-10-24
- 最後登錄
- 2017-8-22
|
3#
發表於 2016-10-28 14:08
| 只看該作者
Sub 同列著色()
Dim Y%, J%, Z%
Y = Cells(Rows.Count, 1).End(3).Row
For J = 2 To Y
For Z = 2 To 7
If Cells(J, Z) = Cells(J, Z + 8) And Cells(J, Z) = Cells(J, Z + 16) And Cells(J, Z) = Cells(J, Z + 24) Then
Cells(J, Z).Interior.ColorIndex = 8
Cells(J, Z + 8).Interior.ColorIndex = 8
Cells(J, Z + 16).Interior.ColorIndex = 8
Cells(J, Z + 24).Interior.ColorIndex = 8
ElseIf Cells(J, Z) = Cells(J, Z + 8) And Cells(J, Z) = Cells(J, Z + 16) Then
Cells(J, Z).Interior.ColorIndex = 4
Cells(J, Z + 8).Interior.ColorIndex = 4
Cells(J, Z + 16).Interior.ColorIndex = 4
ElseIf Cells(J, Z) = Cells(J, Z + 8) Then
Cells(J, Z).Interior.ColorIndex = 6
Cells(J, Z + 8).Interior.ColorIndex = 6
Else: GoTo 101
End If
101: Next
Next
End Sub
同列相同著色.rar (196.62 KB)
|
|