首页 > 解决方案 > 从自动更新的 Excel 数据创建日历

问题描述

我想:

那可能吗?我可以使用什么功能?

谢谢,

亚历克斯

标签: excelvbaoutlookgoogle-calendar-apiicalendar

解决方案


您可以使用Worksheet.Change事件,它会在用户或外部链接更改工作表上的单元格时运行。

例如(以下代码示例将 A1:A10 范围内的值设置为大写,因为数据输入到单元格中):

Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A1:A10")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
    Application.EnableEvents = False
    'Set the values to be uppercase
    Target.Value = UCase(Target.Value)
    Application.EnableEvents = True
End Sub

有关更多信息,请参阅此链接:

Worksheet.Change 事件 (Excel)


推荐阅读