sparkytech
Board Regular
- Joined
- Mar 6, 2018
- Messages
- 96
- Office Version
- 365
- 2019
I have the code below (created by others) that highlights changes to cells. It currently does this for the entire sheet. How can I limit this to the table?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 1 Then Exit Sub
Dim i As Double
i = ActiveSheet.Cells(Application.Rows.Count, "A").End(xlUp).Row
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
If Target.Row > i Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 30)).Interior.ColorIndex = 46
ElseIf Target.Row <= i Then
Target.Interior.ColorIndex = 19
End If
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub