Excel 项目计划 project timeline 甘特图填色

1.优化甘特图填色

 2.增加工作日统计

Sub fillcolor()
'开始到结束行
For i = 3 To 71
'清除填充色
For j = 11 To 169
If Cells(i, j).Interior.Color <> 14277081 Then
Cells(i, j).Interior.Color = 16777215
End If
Next

'工作日清0
wd = 0
'开始到结束列
For j = 11 To 169
'周末是浅灰色,所以周末不能填色
If Cells(i, j).Interior.Color <> 14277081 Then
'当前列的日期 在某个范围内
If Cells(2, j) >= Cells(i, 4) And Cells(2, j) <= Cells(i, 5) Then
'工作日+1
wd = wd + 1
'如果取色的位置是白色
If Cells(i, 3).Interior.Color = 16777215 Then
'单元格填充浅蓝
Cells(i, j).Interior.Color = 15773696
Else
'其他用取到的颜色填充
Cells(i, j).Interior.Color = Cells(i, 3).Interior.Color
End If
End If
End If
Next
'填充工作日
Cells(i, 6) = wd
Next
End Sub

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值