SheetChange Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I need a little help with SheetChange Event. What additional code is needed
to test the following example? I understand code is required that connects
the sheet name to syntax when placed in the Microsoft Visual Basic tool.
However, I’ve not been able to determine the code.

Here is the example:

This example changes the color of changed cells to blue.

Private Sub Worksheet_Change(ByVal Target as Range)
Target.Font.ColorIndex = 5
End Sub

I really appreciate you’ll assistance.

Thanks
Paul
 
Nothing needs to be added to that code. That will change the font color
of the changed cells. If it doesnt seem to be doing anything, try
closing excel and launching a new workbook, then retry the code.
 
Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)
Target.Font.ColorIndex = 5
End Sub

While sh holds a reference to the sheet where the cell was changed, Target
also contains that information, so no additional code is needed nor is a
separate reference to the sheet needed.
 
Back
Top