Option
Explicit
Private
Sub
Workbook_SheetActivate(
ByVal
Sh
As
Object
)
If
Not
TypeOf
Sh
Is
Excel.Worksheet
Then
Exit
Sub
End
If
If
Sh.Name =
"Blanko"
Then
Call
Blanko_Activated(Sh)
Else
Call
Month_Activated(Sh)
End
If
End
Sub
Private
Sub
Blanko_Activated(
ByVal
Worksheet
As
Excel.Worksheet)
Call
Application.Goto(Worksheet.Range(
"A19"
),
True
)
End
Sub
Private
Sub
Month_Activated(
ByVal
Worksheet
As
Excel.Worksheet)
Dim
rng
As
Range
Set
rng = Worksheet.Range(
"A:A"
).Find(What:=
Date
- 5, LookIn:=xlValues, LookAt:=xlWhole)
If
Not
rng
Is
Nothing
Then
Call
Application.Goto(rng,
True
)
End
If
End
Sub