You could try these 2 functions :-
They take "04.01.-10.01." and "01 / 2009" as arguments
and
return 11.01.-17.01 and 03 / 2009 respectively (weeknum used excels weeknum function, so it doesnt agree with yours but you can adjust)
Private Function NextWeek(Strng As String, yearS As String) As String
Dim DateValue As Date
DateValue = Left(Strng, 2) & "/" & Mid(Strng, 4, 2) & "/" & Right(yearS, 4)
DateValue = DateValue + 7
NextWeek = Left(DateValue, 2) & "." & Mid(DateValue, 4, 2) & ".-"
DateValue = DateValue + 6
NextWeek = NextWeek & Left(DateValue, 2) & "." & Mid(DateValue, 4, 2)&"."
End Function
Private Function NextWeekNum(Strng As String, yearS As String) As String
Dim DateValue As Date
DateValue = Left(Strng, 2) & "/" & Mid(Strng, 4, 2) & "/" & Right(yearS, 4)
DateValue = DateValue + 13
NextWeekNum = Format(Application.WorksheetFunction.WeekNum(DateValue), "00") & " / " & Right(DateValue, 4)
End Function
Add this to your code in place of isdate....
Range("b21").Value = NextWeek(Range("C21"), Range("C22"))
Range("b22").Value = NextWeekNum(Range("C21"), Range("C22"))
Bookmarks