Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? [email protected] Excel Programming 4 May 29th 09 10:13 PM
Need to modify code Greg H.[_3_] Excel Programming 8 June 19th 08 06:42 PM
Modify existing code to dynamic code Ixtreme Excel Programming 5 August 31st 07 11:42 AM
almost there ... code modify help Ray Excel Programming 1 March 29th 07 12:58 PM
Code for modify a column CCC Excel Programming 1 October 25th 03 04:16 PM


All times are GMT +1. The time now is 07:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"