VBA Highlight Row if Cell Changes Excel Table

LearnerD

New Member
Joined
Oct 21, 2014
Messages
27
I'd like to be able to identify if any cell in an excel table has changed by either highlighting the whole row or the cell in question. Can't use track changes because doesn't work with excel tables.

Any ideas? have searched and searched but can't find any solutions :(
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.Color = 45678
End Sub
This needs to go in the Sheet module
 
Upvote 0
Thank you SO much, so simple, you wouldn't believe how long I searched for that LOL :LOL: I'm already using the sub worksheet change code for something else so I literally just had to use the 2nd line !
 
Upvote 0
oops just noticed an issue ! my other change bit doesn't work now? I assume it's just a matter of moving stuff around and will experiment but you might know right away by looking at it . The other code is for multi-select in a data validation list box. There is also a 3rd option for changing a date in a cell you can see that below and that works ! just not the multi-select

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
Dim strVal As String
Dim i As Long
Dim lCount As Long
Dim Ar As Variant
On Error Resume Next
Dim lType As Long
Target.Interior.Color = 255255
If Target.Row > 1 Then Cells(Target.Row, "I") = Date
If Target.Count > 1 Then GoTo exitHandler


lType = Target.Validation.Type
If lType = 3 Then
Application.EnableEvents = False
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If oldVal = "" Then
Else
If newVal = "" Then
Else
On Error Resume Next
Ar = Split(oldVal, ", ")
strVal = ""
For i = LBound(Ar) To UBound(Ar)
Debug.Print strVal
Debug.Print CStr(Ar(i))
If newVal = CStr(Ar(i)) Then
strVal = strVal
lCount = 1
Else
strVal = strVal & CStr(Ar(i)) & ", "
End If
Next i
If lCount > 0 Then
Target.Value = Left(strVal, Len(strVal) - 2)
Else
Target.Value = strVal & newVal




End If
End If
End If

End If


exitHandler:
Application.EnableEvents = True
End Sub
 
Last edited:
Upvote 0
All good ! experimentation got it to work, I just moved the colour and date changes to the very end :)
 
Upvote 0
Glad you got it sorted & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top