VBA宏WeekNum未定义

时间:2015-11-19 04:02:26

标签: vba excel-vba week-number excel

我试图在VBA中将Year与WeekNum结合起来。但它表示WeekNum Sub或Function没有定义。 我怎么解决这个问题?这是我的代码:

For lrow = EndRow To 2 Step -1
    CurrentSheet.Cells(lrow, "AC").Value = _
    CONCATENATE(Year(CurrentSheet.Cells(lrow, "K").Value), _
    "/", Text(WeekNum(CurrentSheet.Cells(lrow, "K").Value), "00"))
Next lrow

*请注意,我这只是一行,只是使用_只是为了阅读能力

谢谢! :)

1 个答案:

答案 0 :(得分:0)

在前面添加For lrow = EndRow To 2 Step -1 CurrentSheet.Cells(lrow, "AC").Value = _ CONCATENATE(Year(CurrentSheet.Cells(lrow, "K").Value), _ "/", Text(Application.WorksheetFunction.WeekNum(CurrentSheet.Cells(lrow, "K").Value), "00")) Next lrow

knife cookbook delete