Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need help to modify code to track changes in a column
I have been tasked with tracking if people fill in their time sheets in on
time. I was able to find the following code to track and copy changes to rows within a spreadsheet, but I need to modify it to be able to do columns instead any help would be appreciated. -------------- Dim myRows() As Long Private Sub Worksheet_Change(ByVal Target As Range) Dim myRow As Long Dim myVal As Variant If Target.Cells.Count 1 Then Exit Sub On Error GoTo NotDimmed test = UBound(myRows) GoTo Dimmed NotDimmed: ReDim myRows(1 To 1) Dimmed: For i = 1 To UBound(myRows) If myRows(i) = Target.Row Then Exit Sub Next i ReDim Preserve myRows(1 To UBound(myRows) + 1) myRows(UBound(myRows)) = Target.Row With Application .EnableEvents = False .ScreenUpdating = False myVal = Target.Value myRow = Sheets("History Sheet").Cells(Rows.Count, 3).End(xlUp)(2).Row Intersect(Target.EntireRow, ActiveSheet.UsedRange).Copy _ Sheets("History Sheet").Cells(myRow, 3) Sheets("History Sheet").Cells(myRow, 2).Value = Now Sheets("History Sheet").Cells(myRow, 1).Value = .UserName Target.Value = myVal .ScreenUpdating = True .EnableEvents = True End With End Sub ---------------- As an added question could this be modified so that when an employee changes their time it records the info in a different spreadsheet instead of in the active one? Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? | Excel Programming | |||
Need to modify code | Excel Programming | |||
Modify existing code to dynamic code | Excel Programming | |||
almost there ... code modify help | Excel Programming | |||
Code for modify a column | Excel Programming |