Code WAY too slow... (worksheet_change event)
I am working with a spreadsheet that has several thousand rows. I
wanted to be able to track when rows have been added or updated so I
wrote a simple macro that adds the current date to the last column
whatever row changed.
'Private Sub Worksheet_Change(ByVal Target As Range)
'For Each cell In Target
' Sheet9.Cells(cell.Row, 19) = Date
' Application.EnableEvents = True
'Next cell
'End Sub
This works great when someone simply changes a value, but if I add a
NEW row (by copying a line and inserting it below) the code above takes
nearly a minute to complete. How can I make it faster?
|