XLA routines: EE_ColorSheetTabs

Nick's picture
EE_ColorSheetTabs is an easy sub that takes a range of coloured cells with sheet tab names in it. - colours the sheet tabs in accordance with the cell colour.
Sub EE_ColorSheetTabs(rngColor As range)
    Dim rngEach     As range
    Dim wbk         As Workbook
'http://excelexperts.com/xla-routines-eeColorSheetTabs    for updates on this sub routine
    
    Set wbk = ThisWorkbook
 
    For Each rngEach In rngColor
        On Error Resume Next
        wbk.Worksheets(rngEach.value).Tab.Color = rngEach.Interior.Color
        Err.Clear: On Error GoTo 0: On Error GoTo -1
    Next rngEach
 
    Set rngEach = Nothing
    Set wbk = Nothing
End Sub