0

I'm trying to concancenate Year with WeekNum in VBA. But it said that the WeekNum Sub or Function does not defined. How can I solve this? Here is my code :

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

*Note that I do this a line only, just using _ just for reading capability

Thanks! :)

Community
  • 1
  • 1
IlhamideaZ
  • 103
  • 10

1 Answers1

0

Add Application.WorksheetFunction in front:

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
jeff carey
  • 2,313
  • 3
  • 13
  • 17