0

我想知道是否有一个 VBA 代码可以使用,如果 R 列中的日期是今天的日期,那么可以弹出一个提醒框并说“你有电话要打”或类似的东西?可能有许多相同的日期,但只需要在打开工作表时弹出一个框,让员工查看他们的回拨列表。

我现在拥有的:

For Each c In checkhere If c.Value = Date Then MsgBox "You have some call backs to make" Exit For End If Next 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
4

1 回答 1

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
于 2013-03-28T17:12:51.997 回答