Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Track whose made changes

I was wondering if anyone new a way to create a user prompt that would ask
for user initials when the user opened the workbook. Then save that
information along with the date if they make changes. If they don't make
changes then there's no reason to save that they logged in. I was thinking
this may be a good way to track changes when they forget to update the
revision date field. I haven't started coding this yet. So I appreciate any
and all ideas.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Track whose made changes

you can add this to the thisworkbook module and see if it helps

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim ws As Worksheet
Dim lastrow As Long
Set ws = Worksheets("Sheet1")
lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row
Range("A" & lastrow).Offset(1, 0) = Environ("Usernme") & " " & Format(Now,
"mm-dd-yyyy")

End Sub

--


Gary


"Kiba" wrote in message
...
I was wondering if anyone new a way to create a user prompt that would ask
for user initials when the user opened the workbook. Then save that
information along with the date if they make changes. If they don't make
changes then there's no reason to save that they logged in. I was thinking
this may be a good way to track changes when they forget to update the
revision date field. I haven't started coding this yet. So I appreciate any
and all ideas.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Track whose made changes

In a standard module, include this single line:
Public firstime As Boolean

In ThisWorkbook code, insert:
Private Sub Workbook_Open()
firstime = True
End Sub


In Worksheet code of any sheet you want to catch changes, insert:
Private Sub Worksheet_Change(ByVal Target As Range)
If firstime = True Then
firstime = False
n = Sheets("changes").Cells(Rows.Count, 1).End(xlUp).Row + 1
Application.EnableEvents = False
Sheets("changes").Cells(n, 1).Value = Now
Sheets("changes").Cells(n, 2).Value = Environ("UserName")
Application.EnableEvents = True
End If
End Sub


This routine uses a special sheet called "changes" to keep the audit
records. The user opens the workbook. The first time a change is made, the
routine records the user's name and date in the "changes" worksheet. The
next time this user or any other user opens the book and makes changes, the
info will be recorded in the next available line.


You must include the "changes" worksheet before inserting the macros.

--
Gary''s Student - gsnu200724


"Kiba" wrote:

I was wondering if anyone new a way to create a user prompt that would ask
for user initials when the user opened the workbook. Then save that
information along with the date if they make changes. If they don't make
changes then there's no reason to save that they logged in. I was thinking
this may be a good way to track changes when they forget to update the
revision date field. I haven't started coding this yet. So I appreciate any
and all ideas.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Track whose made changes

Is there a way to set it to only keeps track of 10 or so logs autimatically?

"Gary''s Student" wrote:

In a standard module, include this single line:
Public firstime As Boolean

In ThisWorkbook code, insert:
Private Sub Workbook_Open()
firstime = True
End Sub


In Worksheet code of any sheet you want to catch changes, insert:
Private Sub Worksheet_Change(ByVal Target As Range)
If firstime = True Then
firstime = False
n = Sheets("changes").Cells(Rows.Count, 1).End(xlUp).Row + 1
Application.EnableEvents = False
Sheets("changes").Cells(n, 1).Value = Now
Sheets("changes").Cells(n, 2).Value = Environ("UserName")
Application.EnableEvents = True
End If
End Sub


This routine uses a special sheet called "changes" to keep the audit
records. The user opens the workbook. The first time a change is made, the
routine records the user's name and date in the "changes" worksheet. The
next time this user or any other user opens the book and makes changes, the
info will be recorded in the next available line.


You must include the "changes" worksheet before inserting the macros.

--
Gary''s Student - gsnu200724


"Kiba" wrote:

I was wondering if anyone new a way to create a user prompt that would ask
for user initials when the user opened the workbook. Then save that
information along with the date if they make changes. If they don't make
changes then there's no reason to save that they logged in. I was thinking
this may be a good way to track changes when they forget to update the
revision date field. I haven't started coding this yet. So I appreciate any
and all ideas.

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
"Track Changes" - Prevent turn off track changes to meet SOX regs Tammy Miller Excel Discussion (Misc queries) 2 July 31st 07 11:42 AM
how to track changes made to a excel sheet using VisualBasic Daffo Excel Discussion (Misc queries) 10 August 31st 06 06:10 AM
Can I track changes made to a shared file per userid. Julie _at_GBS Excel Discussion (Misc queries) 4 May 3rd 05 01:52 PM
TOM you made my day... darno[_15_] Excel Programming 0 March 3rd 04 07:05 PM
TOM you made my day... darno[_5_] Excel Programming 4 February 18th 04 04:10 AM


All times are GMT +1. The time now is 03:38 AM.

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

About Us

"It's about Microsoft Excel"