Results 1 to 2 of 2

Update cell based on conditions in other worksheets

Threaded View

  1. #1
    Registered User
    Join Date
    04-03-2010
    Location
    Orlando, FL
    MS-Off Ver
    Office 365
    Posts
    94

    Update cell based on conditions in other worksheets

    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
    Last edited by wpryan; 04-27-2010 at 11:13 PM. Reason: solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1