please could someone help me. I have been trying and could not seems to resolve this.
I want to compare the date in Column J to the current week. My code also include finding the last row and automatically loop until the last row.
I currently trying with the following code but having issue with
Recievedate = Format(Cells(i, "J").Value, "ww-yyyy")
I have tried
Recievedate = Format(Range(i, "J").Value, "ww-yyyy")
which was found in another post but it doesn't work. Can someone tell me what have I done wrong please? Please ignore the code after MsgBox "OK" as I am trying to build this step by step. Thank you.
Sub macro1()
Range("A1").Select
Range("A" & Rows.Count).End(xlUp).Select ' Find last row in column A and remember the active cell
Dim i As Integer
Dim Recievedate As Date
For i = 2 To ActiveCell.Row 'start from row 2 and automatically +1 until it reach the active cell
Recievedate = Format(Cells(i, "J").Value, "ww-yyyy")
If Recievedate = Format(Date, "ww-yyyy") Then
MsgBox "OK"
End If
Next i
...