分享

Excel日期提醒不用愁

 xfshok 2017-04-25

今天又便宜问如何能让表格自动对日期进行提醒,其实很简单,教两个常用方法:

Excel日期提醒不用愁

方法一:条件格式

Excel日期提醒不用愁

方法二:VBA

'关注微信公众账号“E殿园”,回复“到期提醒”获取源码下载地址

Sub auto_open()

Dim Rng As Range

Dim wkSht As Worksheet

Dim Str As String

Dim LstR As Long

Dim AR

Application.ScreenUpdating = False

Set wkSht = Sheets('Sheet1')

wkSht.Range('A2').CurrentRegion.Interior.Color = xlNone

AR = wkSht.Range('G2:G' & wkSht.Cells(Rows.Count, 1).End(xlUp).Row)

For LstR = 1 To UBound(AR)

If AR(LstR, 1) <> '' And AR(LstR, 1) <= date="">

If Rng Is Nothing Then

Set Rng = wkSht.Cells(LstR + 1, 7)

Else

Set Rng = Union(Rng, wkSht.Cells(LstR + 1, 7))

End If

End If

Next

If Not Rng Is Nothing Then

Rng.Interior.ColorIndex = 3

End If

Set Rng = Nothing

Set wkSht = Nothing

Application.ScreenUpdating = True

End Sub

更多源码请关注微信公众号“E殿园”

免费工具箱交流群:585072602

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多