Dim MonthValue As Integer
Dim MonthDays As Integer
MonthValue = DatePart("m", p, vbMonday)
MonthDays = DatePart("d", DateAdd("d", -1, CDate("1/" & MonthValue + 1 & "/2008")))
Dim fileName As String
fileName = MonthName(DatePart("m", p, vbMonday), False) & "wk" & CInt(MonthDays / 7) & ".xls"
Debug.Print fileName
|