Workbook change event when tab color changed?

D

David Billigmeier

If I change a tab color, can I create a macro to automatically run and do the
following:
1) pull the tab name that was just changed
2) pull the color index that it was changed to?

What I'm going to do with the above 2 items is then color another cell on a
summary tab to match

Thanks
 
B

Barb Reinhardt

I'm not aware of a worksheet tab event, but you can pull that info this way

Sub WSTab()
Dim WS As Worksheet
Dim WB As Workbook
Set WB = ActiveWorkbook
For Each WS In WB.Worksheets
If WS.Tab.ColorIndex = xlColorIndexNone Then
Debug.Print WS.Name, "No tab color"
Else
Debug.Print WS.Name, WS.Tab.ColorIndex
End If
Next WS

End Sub
 
Top