VBA Code will not affect multiple sheets
Posted by Charles Nilsen on October 04, 2001 4:39 AM
First, thanks to those who helped me yesterday with this...
Now I am trying to make my script, which highlights in yellow any cell that changes along with it's dependents, work for ALL sheets in a workbook. Thoughts?
I have the following code, in the window in the VBA editor under "Worksheet" on the left pull down and "sheet change" for the right pull down:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Target.Interior.ColorIndex = 6
On Error Resume Next
If Target.Dependents Is Empty Then
Target.Dependents.Interior.ColorIndex = 6
End If
End Sub
I'm sure that where I have this code is part of the problem, but I don't know what else to do with it.