• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA to change color when cell updated

nagarajkp

New Member
I am tring to change color of a cell in a cell range("A10:F100") when ever a cell in the range is updated from previous value by formula due to change in other worksheet . Please help in this regard
 
Something like this?
See example
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range, r As Range
Set Rng = Range("A10:F100")
If Intersect(Target, Rng) Is Nothing Then Exit Sub
For Each r In Target
    Application.EnableEvents = False
        r.Interior.ColorIndex = 4
    Application.EnableEvents = True
Next
End Sub
 

Attachments

  • color on value change.xlsm
    14.1 KB · Views: 3
worksheet _change fires only when there is change in the cell made manually but not when change in the value due to formula. I think worksheet _calculate does the work,but do not aware how to code it.
 
Back
Top