我想知道是否有一个我可以使用的VBA代码,如果R列中的日期是今天的日期,可以弹出一个提示框并说出“你有要求制作”或沿着那些方向的东西?可能有许多日期相同,但只需要在打开工作表时弹出一个框,以使员工查看其回拨列表。
我现在拥有的:
For Each c In checkhere 如果c.Value = Date Then MsgBox“你有一些回电要做” 退出 万一 下一个c
Dim NewControl As CommandBarControl
Application.CommandBars("Cell").Controls("Insert Date").Delete
Set NewControl = Application.CommandBars("Cell").Controls.Add
With NewControl
.Caption = "Insert Date"
.OnAction = "Module1.OpenCalendar"
.BeginGroup = True
End With
End Sub
答案 0 :(得分:3)
将此放入'ThisWorkbook'
Private Sub Workbook_Open()
Dim checkhere As Range
Set sh = Sheets("yoursheethere")
Set checkhere = sh.Range("R1:R" & sh.Range("R1").End(xlDown).Row)
For Each c In checkhere
If c.Value = Date Then
MsgBox "You have some unanswered calls"
Exit For
End If
Next c
End Sub