The following code colours a worksheet tab if a value is entered anywhere on the sheet. It works well until I attempt to share the workbook, then I receive "Run-time error '1004': Application-defined or object-defined error.".
Anyone see why?
Anyone see why?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Me.Tab.Color = xlNone
If WorksheetFunction.CountA(Me.Cells) <> "0" Then Me.Tab.Color = RGB(255, 0, 0)
End Sub