Hello,
Hoping someone can explain why this code stops on this line: "ThisWorkbook.Worksheets("Status of Closing").range("H11").value = Date" I watched this code run and it skips over this line and jumps back up to the sub and re-runs again. I am not sure why it wont finish the rest of my code? Can someone please explain what I'm doing wrong?
Hoping someone can explain why this code stops on this line: "ThisWorkbook.Worksheets("Status of Closing").range("H11").value = Date" I watched this code run and it skips over this line and jumps back up to the sub and re-runs again. I am not sure why it wont finish the rest of my code? Can someone please explain what I'm doing wrong?
Code:
Private Sub worksheet_calculate()
Dim target As range
Dim xlrange As range
Dim valuetofind As String
Dim cell As range
Dim value As String
Dim nextstep As String
If ThisWorkbook.Worksheets("Status of Closing").range("A37").value = True Then
If ThisWorkbook.Worksheets("Status of Closing").range("M11") = "" Then
ThisWorkbook.Worksheets("Status of Closing").Unprotect Password:="Team"
ThisWorkbook.Worksheets("Status of Closing").range("D5").value = "Pending Review"
ThisWorkbook.Worksheets("Status of Closing").range("M11").value = "File is ready for closer to review"
ThisWorkbook.Worksheets("Status of Closing").range("H11").value = Date
ThisWorkbook.Worksheets("Status of Closing").Protect Password:="Team"
Else
ThisWorkbook.Worksheets("Status of Closing").Protect Password:="Team"
End If
End If
If ThisWorkbook.Worksheets("Status of Closing").range("Y31").value = Date Then
nextstep = "Balance CD with title"
ElseIf ThisWorkbook.Worksheets("Status of Closing").range("Y29").value = "" Then
nextstep = "Title fees to be requested"
Else
nextstep = "Balance CD with title"
End If
If ThisWorkbook.Worksheets("Status of Closing").range("V41").value = True Then
If ThisWorkbook.Worksheets("Status of Closing").range("M11") = "File is ready for closer to review" Then
ThisWorkbook.Worksheets("Status of Closing").Unprotect Password:="Team"
ThisWorkbook.Worksheets("Status of Closing").range("D5").value = "Closer Reviewing"
ThisWorkbook.Worksheets("Status of Closing").range("H11").value = Date
ThisWorkbook.Worksheets("Status of Closing").range("M11").value = nextstep
ThisWorkbook.Worksheets("Status of Closing").Protect Password:="Team"
valuetofind = ThisWorkbook.Worksheets("Status of Closing").range("D3").value
Set xlrange = ThisWorkbook.Worksheets("Tracker").range("A2:A200")
For Each cell In xlrange
If cell.value = valuetofind Then
cell.Offset(0, 6).value = ThisWorkbook.Worksheets("Status of Closing").range("D5").value
cell.Offset(0, 7).value = Date
cell.Offset(0, 9).value = ThisWorkbook.Worksheets("Status of Closing").range("H11").value
cell.Offset(0, 10).value = ThisWorkbook.Worksheets("Status of Closing").range("M11").value
End If
Next
End If
End If
End Sub