Hi, I am trying to convert dates to weeks. So from beginning of the year:
Week 1 (Jan 1st - 6th)
week 2 (jan 7th - Jan 13th)
My Code now and btw its very slow not sure if there is a better way to do this.
I am not sure how to set it up so it Starts from Jan 1st and it goes to Jan6th as week 1, and move along and review the dates and mark as Week 1 or Week 2 dependent on the dates.
Dates are in Column B and week ouput (week1,week 2) can be placed in Column AA. Worksheet name: "Data-Weeks".
thank you for anyone that can help as I am struggling.
Week 1 (Jan 1st - 6th)
week 2 (jan 7th - Jan 13th)
My Code now and btw its very slow not sure if there is a better way to do this.
Code:
Sub UpdateData() Dim X As Long, LR As Long
Sheets("Data-Weeks").Select
LR = Range("A" & Rows.Count).End(xlUp).Row
For X = 2 To LR
Cells(X, "Z").Value = DatePart("ww", Cells(X, "B"), 4, vbUseSystem)
Next
End Sub
I am not sure how to set it up so it Starts from Jan 1st and it goes to Jan6th as week 1, and move along and review the dates and mark as Week 1 or Week 2 dependent on the dates.
Dates are in Column B and week ouput (week1,week 2) can be placed in Column AA. Worksheet name: "Data-Weeks".
thank you for anyone that can help as I am struggling.