Thread: [Solved] Timestamp Sub failing
View Single Post
 
Old 04-12-2017, 11:15 AM
webba0264 webba0264 is offline Windows 8 Office 2007
Novice
 
Join Date: Jun 2016
Posts: 9
webba0264 is on a distinguished road
Default Timestamp Sub failing

Hello all,

Attached is an .xlsm with Sheet 1 (Accrual!) displaying a table that updates based on Sheet 2 (Catalog!). I pulled these 2 sheets from a larger Workbook to simplify the problem I've having.

If you view code for Accrual!, you can see the Sub I've written (with help from members here at MSOffice Forums). The timestamps no longer update when the table in Accrual! updates, and when I run the debugger this is what I see:

"Compile error.
Variable cannot be defined."

--------------------------------------------------------------------------------------

TotalEnrolled = Range("A17")
End Function
Public Function TotalComplete() As Long
TotalComplete = Range("L17")
End Function

=> Public Sub CheckForChanges()

Application.EnableEvents = False

If Range("A17") <> LastValue.Range("TotalEnrolledLast") Then
Application.EnableEvents = False
Range("A18") = Date + Time
LastValue.Range("TotalEnrolledLast") = Range("A17")
End If

If Range("L17") <> LastValue.Range("TotalCompleteLast") Then
Range("L18") = Date + Time
LastValue.Range("TotalCompleteLast") = Range("L17")
End If

Application.EnableEvents = True
---------------------------------------------------------------------------------

Any help understanding the problem here would be greatly appreciated. Thanks in advance!

-AW
Attached Files
File Type: xlsm Book1_TimestampFail.xlsm (73.6 KB, 12 views)
Reply With Quote