NeuesDatum = DateAdd(
"m"
, -1, Startdatum)
NextMonat = DateAdd(
"m"
, 1, Startdatum)
Dim
j
As
String
Dim
k
As
String
For
i = 1
To
Tage
j = i - 1 &
"."
k = i + 1 &
"."
Worksheets(i &
"."
).Activate
If
i = 1
Then
With
ActiveSheet
.Hyperlinks.Add Anchor:=.Range(
"A1"
), Address:=Pfad &
"\" & Format(NeuesDatum, "
YYYY-MM
") & "
Tagesdokumentation
" & "
.xlsx"
.Hyperlinks.Add Anchor:=.Range(
"D1"
), Address:=Pfad &
"\" & Format(NextMonat, "
YYYY-MM
") & "
Tagesdokumentation
" & "
.xlsx"
.Hyperlinks.Add Anchor:=.Range(
"D2"
), Address:=
""
, SubAddress:=k &
"!A1"
End
With
With
ActiveSheet.Range(
"A1, D1"
)
.Font.Size = 18
.Font.ColorIndex = 1
.Font.Underline =
False
.Font.Bold =
True
End
With
With
ActiveSheet.Range(
"A2, D2"
)
.Font.Size = 14
.Font.ColorIndex = 1
.Font.Underline =
False
End
With
ElseIf
i = Tage
Then
With
ActiveSheet
.Hyperlinks.Add Anchor:=.Range(
"A1"
), Address:=Pfad &
"\" & Format(NeuesDatum, "
YYYY-MM
") & "
Tagesdokumentation
" & "
.xlsx"
.Hyperlinks.Add Anchor:=.Range(
"D1"
), Address:=Pfad &
"\" & Format(NextMonat, "
YYYY-MM
") & "
Tagesdokumentation
" & "
.xlsx"
.Hyperlinks.Add Anchor:=.Range(
"A2"
), Address:=
""
, SubAddress:=j &
"!A1"
End
With
With
ActiveSheet.Range(
"A1, D1"
)
.Font.Size = 18
.Font.ColorIndex = 1
.Font.Underline =
False
.Font.Bold =
True
End
With
With
ActiveSheet.Range(
"A2, D2"
)
.Font.Size = 14
.Font.ColorIndex = 1
.Font.Underline =
False
End
With
Else
With
ActiveSheet
.Hyperlinks.Add Anchor:=.Range(
"A1"
), Address:=Pfad &
"\" & Format(NeuesDatum, "
YYYY-MM
") & "
Tagesdokumentation
" & "
.xlsx"
.Hyperlinks.Add Anchor:=.Range(
"D1"
), Address:=Pfad &
"\" & Format(NextMonat, "
YYYY-MM
") & "
Tagesdokumentation
" & "
.xlsx"
.Hyperlinks.Add Anchor:=.Range(
"A2"
), Address:=
""
, SubAddress:=j &
"!A1"
.Hyperlinks.Add Anchor:=.Range(
"D2"
), Address:=
""
, SubAddress:=k &
"!A1"
End
With
With
ActiveSheet.Range(
"A1, D1"
)
.Font.Size = 18
.Font.ColorIndex = 1
.Font.Underline =
False
.Font.Bold =
True
End
With
With
ActiveSheet.Range(
"A2, D2"
)
.Font.Size = 14
.Font.ColorIndex = 1
.Font.Underline =
False
End
With
End
If
Next