Hey guys,
I have several if thens that i am trying to consolidate into one sub and assign one button to it. All of them seem to work when run on their own, but only the first 2 get executed when put together.
The code is below.
Any ideas?
Thanks,
ritz
Sub dashboardupdate()
    
For Each cell In Range("dashboard")
    'Makes the completed cells green if they were on time
    If cell.Offset(0, 16) > cell.Offset(0, 15) Then
        cell.Offset(0, 15).Interior.ColorIndex = 4
    
    'This will make all past due cells red
        If cell.Offset(0, 16) < cell.Offset(0, 15) Then
            If IsDate(cell.Offset(0, 15)) Then
                cell.Offset(0, 15).Interior.ColorIndex = 3
    
    'Makes the completed cells green if they are equal and they are date values
            If cell.Offset(0, 16) = cell.Offset(0, 16) Then
                If IsDate(cell.Offset(0, 15)) Then
                    cell.Offset(0, 15).Interior.ColorIndex = 4
    
    'This will color due date of today in R with a turqoise color
                If cell.Offset(0, 16) = Range("today") Then
                    cell.Offset(0, 16).Interior.ColorIndex = 8
    
    'This will make all of the empty cells pink if both Q and R are empty
                    If cell.Offset(0, 15) = cell.Offset(0, 16) Then
                        If cell.Offset(0, 16) = "" Then
                            cell.Offset(0, 15).Interior.ColorIndex = 38
    
    'This will make all cells containing a date in R and blank in corresponding Q dark blue
                        If IsDate(cell.Offset(0, 16)) And cell.Offset(0, 15) = "" Then
                            cell.Offset(0, 15).Interior.ColorIndex = 32
    
    'This will make all cells with NAB equal to issue manager with a QA date Complete
                            If cell.Offset(0, 5) = cell.Offset(0, 7) Then
                                If IsDate(cell.Offset(0, 19)) Then _
                                    cell.Offset(0, 32) = "Complete"
                                End If
                            End If
                        End If
                        End If
                    End If
                End If
                End If
            End If
            End If
        End If
    
Next
End Sub