Sub
setIntervall(rng
As
Range)
Dim
dtDatum
As
Date
Dim
interv&, lastcol&, i&, lngRow&
Dim
res
Dim
strSearchDate$
interv = rng.Value
lngRow = 9
lastcol = Cells(lngRow, Columns.Count).
End
(xlToLeft).Column
If
interv = 0
Then
Cells(rng.Row, 21).Resize(1, lastcol - 20).ClearContents
Exit
Sub
End
If
dtDatum = rng.Offset(0, 1).Value
strSearchDate = MonthName(j) &
" "
& Year(dtDatum)
res = Application.Match(strSearchDate, Rows(lngRow), 0)
If
IsNumeric(res)
Then
Application.EnableEvents =
False
For
i = res
To
lastcol
Step
interv
Cells(rng.Row, i).Value = 1
Next
i
Application.EnableEvents =
True
End
If
End
Sub