Excel VBA 質問スレ Part37 [転載禁止]©5ch.io
■ このスレッドは過去ログ倉庫に格納されています
0413デフォルトの名無しさん
2015/07/02(木) 21:01:08.22ID:9qb5cWlQPrivate Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim oMonth As Byte
Dim f As Boolean
oMonth = CByte(Left(Sh.Name, Len(Sh.Name) - 2)) + 1
If oMonth > 12 Then oMonth = 1
If oMonth < Month(Date) Then
f = True
ElseIf oMonth = Month(Date) Then
If Day(Date) >= 1 Then f = True
End If
If f Then
MsgBox "処理A"
End If
End Sub
12月度が反応しちゃうけど「いつまで反応し続けるか」が条件にないし、年度管理しないとそんなもんかなぁ。
■ このスレッドは過去ログ倉庫に格納されています