なろうでは後書きに書いてあったんだけど、カクヨムには後書きって無いんだっけか。
■特定の日にアクションを起こすマクロ■
(本文と異なりファイルを開いただけでは実行されません)
※実装は自己責任で行ってください。
Sub CheckDate()
' 現在の日付を取得
Dim currentDate As Date
currentDate = Date
' 特定の日付を設定(例:2024年9月23日)
Dim specificDate As Date
specificDate = DateSerial(2024, 9, 23)
' 現在の日付が特定の日付と同じかどうかをチェック
If currentDate = specificDate Then
MsgBox "今日は特定の日付です!何か特別なアクションを実行しましょう。", vbInformation
Else
MsgBox "今日は特定の日付ではありません。", vbInformation
End If
End Sub