ColoringFields:
For i = 1 To 7 '(D、E、F、G、H、I、J)
If i < 7 Then .Cells(1, xNumber(1, i) + 1).Interior.ColorIndex = 6 Else .Cells(1, xNumber(1, i) + 1).Interior.ColorIndex = 8
Next
.Copy
End With
HasTheData:
xDate = Format(Mid(Cat, 2, 10), "yyyy/m/d")
With ThisWorkbook.Sheets("總表")
RowNo = 0
RowNo = .[A:A].Find(xDate, Lookat:=xlPart).Row
If RowNo <> 0 Then xNumber = .Range(.Cells(RowNo , "D"), .Cells(RowNo , "J")).Value
End With 'end of numbers getting
請加入紅色自 的 指令,用以避開有空白碼的錯誤:
For i = 1 To 7 '(D、E、F、G、H、I、J)
If xNumber(1, i) <> "" Then
j = Rng.Find(xNumber(1, i), LookIn:=xlValues, searchorder:=xlByColumns).Column
If i < 7 Then .Cells(1, j).Interior.ColorIndex = 6 Else .Cells(1, j).Interior.ColorIndex = 4
End If
Next作者: ziv976688 時間: 2019-5-14 12:04