I have created a function (shown below) and I call it from my excel sheet with the following command
=Progress_Status(Row())
Calculate is set to Automatic. The cells type is General - Not Text (I read this may be the issue, but it is not)
It calculates fine if I select the cell and press enter to re-enter the formula. But if I change any of the cells that the formuale uses it does not do anything, until I re-selct and re-press enter. I have tried doing it in various ways but no joy.
The function is as follows:-
Function Progress_Status(ByVal ThisRow As Integer) As String
Dim Status As String
Status = "On Target"
If Cells(ThisRow, 13) = "Yes" Then
Status = "Completed"
ElseIf Cells(ThisRow, 14) = "On Hold" Then
Status = "On Hold"
ElseIf Cells(ThisRow, 13) = "No" And DateDiff("d", Cells(ThisRow, 12), Now) > 0 Then
Status = "Delayed"
ElseIf Cells(ThisRow, 11) = "No" And DateDiff("d", Cells(ThisRow, 10), Now) > 0 Then
Status = "Delayed"
ElseIf Cells(ThisRow, 9) = "No" And DateDiff("d", Cells(ThisRow, 8), Now) > 0 Then
Status = "Delayed"
ElseIf Cells(ThisRow, 7) = "No" And DateDiff("d", Cells(ThisRow, 6), Now) > 0 Then
Status = "Delayed"
End If
Progress_Status = Status
End Function
Any help would be as always much appreciated
Bookmarks