For j = 10 To 16
If Cells([T5] + 6, j) = [R5] Then '以I欄T5期數有顯示R5值為基準條件
If ([T5] + [Q6]) Mod [R6] = 0 Then
Cells([R6] + 6, j - 8).Interior.ColorIndex = 8
Cells([R6] + 6, j).Interior.ColorIndex = 37
With Cells([Q6] + 6, j - 8)
.Interior.ColorIndex = 8
.Font.ColorIndex = 7
.Font.FontStyle = "粗體"
End With
With Cells([Q6] + 6, j)
.Interior.ColorIndex = 37
.Font.ColorIndex = 7
.Font.FontStyle = "粗體"
End With
Else
For k = 0 To Int(([R6] - ([T5] + [Q6]) Mod [R6]) / [Q6])
Cells(([T5] + [Q6]) Mod [R6] + 6 + [Q6] * k, j - 8).Interior.ColorIndex = 8 'A欄T5期依各間距數往下標示底色
Cells(([T5] + [Q6]) Mod [R6] + 6 + [Q6] * k, j).Interior.ColorIndex = 37
Next k
With Cells(([R6] - ([R6] - ([T5] + [Q6]) Mod [R6]) Mod [Q6] + [Q6]) Mod [R6] + 6, j - 8) 'A欄=k的最後間距期數再加一個間距標示底色
.Interior.ColorIndex = 8
.Font.ColorIndex = 7
.Font.FontStyle = "粗體"
End With
With Cells(([R6] - ([R6] - ([T5] + [Q6]) Mod [R6]) Mod [Q6] + [Q6]) Mod [R6] + 6, j)
.Interior.ColorIndex = 37
.Font.ColorIndex = 7
.Font.FontStyle = "粗體"
End With
End If
End If
If ([T5] + [Q6]) Mod [R6] > 0 Then
Cells(([T5] + [Q6]) Mod [R6] + 6, 1).Interior.ColorIndex = 8 'A欄的T5期數標示底色
Else
Cells([R6] + 6, 1).Interior.ColorIndex = 8
End If
改成:
N = ([T5] + [Q6]) Mod [R6]
If N = 0 Then N = [R6]
Cells(N + 6, 1).Interior.ColorIndex = 8 N = ([T5] + [Q6]) Mod [R6] '再重置N,讓下方引用作者: 准提部林 時間: 2015-11-9 14:35
If ([T5] + [Q6]) Mod [R6] = 0 Then
∼∼
∼∼
End If
改成:
If N = 0 Then '這是延續上方的值(以下同)
Cells([R6] + 6, j - 8).Interior.ColorIndex = 8
Cells([R6] + 6, j).Interior.ColorIndex = 37 X = [Q6]
Else
For k = 0 To Int(([R6] - N) / [Q6])
Cells(N + 6 + [Q6] * k, j - 8).Interior.ColorIndex = 8
Cells(N + 6 + [Q6] * k, j).Interior.ColorIndex = 37
Next k X = ([R6] - ([R6] - N) Mod [Q6] + [Q6]) Mod [R6]
End If
With Cells(X + 6, j - 8)
.Interior.ColorIndex = 8: .Font.ColorIndex = 7: .Font.FontStyle = "粗體"
End With
With Cells(X + 6, j)
.Interior.ColorIndex = 37: .Font.ColorIndex = 7: .Font.FontStyle = "粗體"
End With作者: Airman 時間: 2015-11-9 15:12