excel VBA 自动绘制甘特图

EXCEL 自动数值匹配颜色自动填充

Dim i, j As Integer
Dim str As String
Range("H8:BI89") = Sheet1.Cells(2, "F")
Range("H8:BI89").Interior.ColorIndex = 0
For i = 8 To 89
str = Sheet1.Cells(i, "F")
If (Not IsEmpty(str)) Then
For j = 9 To 61
If Cells(3, j) = str Then
Cells(i, j).Value = str
Cells(i, j).Interior.Color = Sheet1.Cells(i, "D").Interior.Color
End If
Next
End If
Next

posted @ 2021-05-10 13:50  海海的雪  阅读(1621)  评论(0)    收藏  举报