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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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 :laugh: 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
Glad you got it sorted & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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