1、按“ALT+F11”两个按键,弹出VBA模式右击Thisworkbook-插入-模块
2、拷贝下面代码到空白处,然后关闭VBAFunction week2Day(y As Integer, i As Integer, k As Integer) As String Dim datetemp As Date, j As Integer If i > 52 Then MsgBox ("一年最多只有52个周!") weekFristDay = "1900-1-1" Exit Function End If datetemp = y & "-" & 1 & "-" & 1 j = VBA.Weekday(datetemp, vbMonday) j = (8 - j) + (i - 2) * 7 datetemp = DateAdd("d", j + k - 1, datetemp) week2Day = CStr(datetemp)End Function
3、在空单元格中输入下面函数=week2day(2014,1,5) ‘其中第一个参数是年,第二个参数是第几周,第三个参数该周第几天,该函数返回为2014-1-3日