ガントチャート色塗り(超ハードコーディング)
EXCELで作るガントチャート色塗りマクロ(超ハードコーディング)
2行目に日付
3列目に開始日
4列目に終了日
Sub PaintGanttChart()
For r = 4 To 136
If ActiveSheet.Cells(r, 1) = True Then
For col = 7 To 60
ActiveSheet.Cells(r, col).Interior.ColorIndex = xlNone
If ActiveSheet.Cells(2, col).Value >= ActiveSheet.Cells(r, 3) _
And ActiveSheet.Cells(2, col).Value <= ActiveSheet.Cells(r, 4) Then
ActiveSheet.Cells(r, col).Interior.ColorIndex = 35
End If
Next
Else
For col = 7 To 60
ActiveSheet.Cells(r, col).Interior.ColorIndex = xlNone
Next
End If
Next
End Sub


Comments