Hi all
I'm not new to the world of spreadsheets, but very new to the world of VBA. I've only recently started playing around with it to see what it can do.
One of the things that I would like to do is to insert a static date in to a cell when another cell is updated. I have found the following code on these forums and this works well, provided you are updating one cell at a time manually.
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Cells.Count > 1 Then Exit Sub
If Intersect(.Cells, Me.Range("A:A")) Is Nothing Then Exit Sub
.Offset(0,1).Value = Date '''''' or Now
End With
End Sub
My requirement is that the cells update after pasting in several lines of data in one go.
I've found other lines of code for checking for a paste event....
Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox IIf(Application.CutCopyMode = xlCopy, "Pasted", "Normal Entry")
End Sub
...but I am unsure if this is the 'correct' method or even if these can be combined and if they can be combined, how to do this!
Any help is greatly appreciated!
Bookmarks