Hi,
I need help with the following VBA code
For i = 5 To 750
If Cells(i, 19) = "" Or Cells(i, 39) = "Y" Then
Cells(i, 44) = ""
ElseIf Cells(i, 19).Value + 60 > 7 / 31 / 2017 Then
Cells(i, 44) = "OVERDUE"
Else: Cells(i, 44) = "NOT OVERDUE"
End If
Next i
This code is part of procedure which I am using. The intent here is that cell has a date and i want to add 60 days in the date and call it "OVERDUE" if it exceeds specified date in the code. The code runs fine but gives me all cells in 750 row column "OVERDUE" which is not correct because some of the dates are in future and cant be overdue. i am not sure if there is something wrong with the date format or the code itself.
Also, i am using 750 rows which is more than what I need. How do I make sure that code only goes to the last data row and stop?
Any help is much appreciated.
Thanks
I need help with the following VBA code
For i = 5 To 750
If Cells(i, 19) = "" Or Cells(i, 39) = "Y" Then
Cells(i, 44) = ""
ElseIf Cells(i, 19).Value + 60 > 7 / 31 / 2017 Then
Cells(i, 44) = "OVERDUE"
Else: Cells(i, 44) = "NOT OVERDUE"
End If
Next i
This code is part of procedure which I am using. The intent here is that cell has a date and i want to add 60 days in the date and call it "OVERDUE" if it exceeds specified date in the code. The code runs fine but gives me all cells in 750 row column "OVERDUE" which is not correct because some of the dates are in future and cant be overdue. i am not sure if there is something wrong with the date format or the code itself.
Also, i am using 750 rows which is more than what I need. How do I make sure that code only goes to the last data row and stop?
Any help is much appreciated.
Thanks