今天又便宜问如何能让表格自动对日期进行提醒,其实很简单,教两个常用方法: 方法一:条件格式 方法二: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 |
|