如果不指定日期,只是间隔10天。则代码如下
Private Sub Workbook_Open()
Dim rq As Date, hhh As String
rq = Date
hhh = GetSetting(ThisWorkbook.Name, "MySet", "MyKey", "")
If Val(hhh) = 0 Then
SaveSetting ThisWorkbook.Name, "MySet", "MyKey", rq
ElseIf DateValue(rq) - DateValue(hhh) >= 10 Then
MsgBox "您好,该写总结了!", vbOKOnly + vbInformation, "温馨提示"
DeleteSetting ThisWorkbook.Name, "Myset", "MyKey"
SaveSetting ThisWorkbook.Name, "Myset", "MyKey", rq
End If
End Sub
如果指定每月10,20,30日(2月为10,20,28日),则代码如下
Private Sub Workbook_Open()
If Month(Date) = 2 Then
If Day(Date) = 10 Or Day(Date) = 20 Or Day(Date) = 28 Then MsgBox "您好,该写总结了!", vbInformation + vbOKOnly, "温馨提示"
Else
If Day(Date) = 10 Or Day(Date) = 20 Or Day(Date) = 30 Then MsgBox "您好,该写总结了!", vbInformation + vbOKOnly, "温馨提示"
End If
End Sub