|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
我明明设置了当到期日等于今天就标橙色提醒,当到快到到期日前四天,就粉色提醒,为啥我一操作,只要日等于今天的日都会提醒,不管是哪个月份- Sub 到期提醒()
- For i = 3 To Range("b65526").End(xlUp).Row
- If Cells(i, "i") <> "" Then
- Cells(i, "i").Select
- If Day(Cells(i, "i")) = Day(Now()) Then
- MsgBox Cells(i, "e") & "今日到期"
- Rows(i).Interior.ColorIndex = 45
- End If
- If Cells(i, "i") - Now() > 0 And Cells(i, "i") - Now() < 10 Then
- MsgBox Cells(i, "e") & "" & Day(Cells(i, "i")) - Day(Now()) & "天内到期"
- Rows(i).Interior.ColorIndex = 38 '粉色
- End If
- End If
- Next
- End Sub
复制代码
|
|