I have the following code in a Double Click macro. Cells B17 and B18 are marlett checkboxes. I want the tab color to change if either or both cells are checked. If both are not checked I want the tab to be gray.

The code works to change the color, but the color will not change back when I uncheck the cells.

Thanks for your help.

If Not Target.Range("B17,B18").Value = "a" Then
    ActiveWorkbook.Sheets("Document Control").Tab.ColorIndex = 50
    Else
    ActiveWorkbook.Sheets("Document Control").Tab.ColorIndex = 1
End If