MAJOR AMATURE ALERT! I'm trying to code a module to record the time of changes made to a workbook (several worksheets) to another worksheet. I can get the code to record the time of the change for a range with multiple columns to the next cell over (xOffsetColumn = 1). I am trying to send that to another worksheet though and also format the data in a column. I have not yet spent time trying to format to a column, I have just been trying to send the data to another sheet.
This is my code so far:
This is my code so far:
Code:
Private Sub Workbook_SheetChange(ByVal ws As Object, ByVal Target As Range)'Record time of changes made to worksheet
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ActiveWorkbook
Set ws = Sheets("Sheet1")
wb.Activate
ws.Select
Dim WorkRng As Range
Dim xOffsetColumn As Integer
Set WorkRng = Intersect(Application.ActiveSheet.Range("A:E"), Target)
xOffsetColumn = Worksheets("REVISION HISTORY").Range("A1")
If Not WorkRng Is Nothing Then
Application.EnableEvents = False
For Each Rng In WorkRng
If Not VBA.IsEmpty(Rng.Value) Then
Rng.Offset(0, xOffsetColumn).Value = Now
Rng.Offset(0, xOffsetColumn).NumberFormat = "dd-mm-yyyy, hh:mm:ss"
End If
Next
Application.EnableEvents = True
End If
End Sub