Can someone please help. I have the following which I am using to calculate the Week Number is respect of the current date, Today().
I seem to be having an issue with the 2nd half of the function, from " -WeekNum(Date())". When displayed as above it returns the following error:
If I change to " - Application.WorksheetFunction.WeekNum(Date())" for a date of 29/01/2024 it returns "4," rather than "-3", which is what I am hoping to get.
As always, with appreciation.
VBA Code:
With ThisWorkbook.Worksheets("Tracker") ' Select workbook and sheet.
.Cells(.Rows.Count, "M").End(xlUp).Offset(0, 1) = Application.WorksheetFunction.WeekNum(ThisWorkbook.Worksheets("Tracker") _
.Cells(.Rows.Count, "M").End(xlUp).value - WeekNum(Date))
End With
I seem to be having an issue with the 2nd half of the function, from " -WeekNum(Date())". When displayed as above it returns the following error:
Comile error:
Sub or Function not defined
If I change to " - Application.WorksheetFunction.WeekNum(Date())" for a date of 29/01/2024 it returns "4," rather than "-3", which is what I am hoping to get.
As always, with appreciation.