New to the forum. Forgive me if I jack up the code posting. I'm trying to fix my macro to run an audit log (originally found on this website). It'll log the name and timestamp if I hit F5 in the module, but will not log it in by itself. Any thoughts?
Private Sub Workbook_Open()
Dim NR As Long
With Sheets("AuditLog")
NR = .Range("A" & .Rows.Count).End(xlUp).Row + 1
.Range("A" & NR).Value = Environ("Username")
.Range("B" & NR).Value = Now
End With
ThisWorkbook.Save
End Sub
Private Sub Workbook_Open()
Dim NR As Long
With Sheets("AuditLog")
NR = .Range("A" & .Rows.Count).End(xlUp).Row + 1
.Range("A" & NR).Value = Environ("Username")
.Range("B" & NR).Value = Now
End With
ThisWorkbook.Save
End Sub