I am using this code to update a sheet once excel is done querying a DB, it gets dumped into the second sheet called Data and there it gives me a timestamp in cell C1. Like it alot but when there is alot of data it will sit there update each cell and update the time stamp. can someone fix it where when just A2 gets updated to perform this function??
Private Sub workbook_Beforesave(ByVal SaveAsUi As Boolean, Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Select
If Not ws.Range("a1") = ws.Range("A1") Then
Range("A1") = "Last Revision on: " & Now
Else: End If
Next ws
' Use "Now" for date and Time, use "Date" for just date
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range("c1") = "Last Run" & Now
Application.EnableEvents = True
End Sub
Private Sub workbook_Beforesave(ByVal SaveAsUi As Boolean, Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Select
If Not ws.Range("a1") = ws.Range("A1") Then
Range("A1") = "Last Revision on: " & Now
Else: End If
Next ws
' Use "Now" for date and Time, use "Date" for just date
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range("c1") = "Last Run" & Now
Application.EnableEvents = True
End Sub