Hi All, Thanks again for all your help in the past... Now on to the next one!
The code below is used to take data from three separate worksheets, compare conditions before adding summary text to the first worksheet (Report). The problem with it is, it doesn't automatically update when one of the conditions in the other worksheets are changed - I have to change or re-enter the data on the "report" worksheet before it updates. The code below is written in the Worksheet_Change event of the Report worksheet. I'd like it to update automatically, and I think this involves a loop of some kind, but I'm not switched on enough to do that. Can anyone help? Code is here:
'Populate System Status
On Error GoTo oops
Application.EnableEvents = False
Dim SvcPass As String
SvcPass = Worksheets("Routine Service").Range("D17").Value
Dim TSCPass As String
TSCPass = Worksheets("Technical Security Check").Range("C41").Value
Dim SvcOvr As String
SvcOvr = Worksheets("Routine Service").Range("H17").Value
Dim TSCOvr As String
TSCOvr = Worksheets("Technical Security Check").Range("C43").Value
Dim Perf As String
Perf = Worksheets("Report").Range("H12").Value
Dim Status As Range
Set Status = Worksheets("Report").Range("F56")
If Perf = "Yes" Then
If SvcPass = "Pass" And TSCPass = "Pass" Then
Status = "Released for Treatments"
ElseIf SvcPass = "Pass" And TSCOvr = "Yes" Or SvcPass = "Yes" And TSCOvr = "Pass" Then
Status = "Released with Justification"
Else
Status = "Not Released for Treatments"
End If
End If
If Perf = "No" Then
If SvcPass = "Pass" Then
Status = "Released for Treatments"
ElseIf SvcOvr = "Yes" Then
Status = "Released with Justification"
Else
Status = "Not Released for Treatments"
End If
End If
oops: Application.EnableEvents = True
Bookmarks