Microsoft Office Tutorials and References
In Depth Information
Logging Actions When a Cell Changes
Figure 42 – Log Actions (After Logging)
View the Appendix to learn how to store this procedure
in a Standard module.
Option Explicit¶
' * * * * *¶
Private Declare Function GetUserName Lib "advapi32.dll" Alias _¶
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long¶
' * * * * *¶
Sub LogInfo(ByVal Target As Range)¶
'Variable declaration¶
Dim FilePath As String¶
Dim File As Long¶
Dim Length As Long¶
Dim Workbook As String¶
Dim Worksheet As String¶
Dim Address As String¶
Dim Value As Variant¶
Dim Username As String¶
Dim TimeStamp As Date¶
Dim Formula As String¶
Dim Cell As Range¶
'The log file will contain:¶
'Workbook full name, Worksheet, Range address,¶
'New Value, Formula, Username and a time stamp¶
FilePath = "\\Server\apps\logme.csv"¶
FilePath = "C:\logme.csv"¶
Search JabSto ::

Custom Search