0

Would anyone be able to help me with this issue?

I have data based on the categories (as per spent) in specific columns & cells, i.e., C4:C25, F4:F25, I4:I10.

However, I want the "Updated date & Time stamp" in a specific cell, i.e. I23 whenever I update any cell of the ranges mentioned above.

enter image description here

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Dec 22, 2022 at 14:39

1 Answer 1

0

The following code was absolutely not tested. You will need to do the necessary research to fix up my errors.

Function InRange(Range1 As Range, Range2 As Range) As Boolean
' returns True if Range1 is within Range2
Dim InterSectRange As Range
Set InterSectRange = Application.Intersect(Range1, Range2)
InRange = Not InterSectRange Is Nothing
Set InterSectRange = Nothing
End Function

Private Sub Worksheet_Change(ByVal Target As Range)
  Set Range1 = Range("C4:C25")
  Set Range2 = Range("F4:F25")
  Set Range3 = Range("I4:I10")
  If InRange(Target.Address, Range1) OR InRange(Target.Address, Range2) OR InRange(Target.Address, Range3) Then
    Range("I23").Value = Now
  End If
End Sub

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .