-
Hi DR,
You can skip the Copy/PasteSpecial by inserting the time directly.
[vba].Range("A" & lastrow) = Now
[/vba]
Exactly the same methodology, but compress the code a bit
[VBA]Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim DestSheet As Worksheet
'A1 changed?
If Not Intersect(Target, Range("A1")) Is Nothing Then
'create object
Set DestSheet = Sheets("Sheet2")
With DestSheet.Range("A65536").End(xlUp).Offset(1)
.NumberFormat = ("h:mm:ss.00")
.Value = Now
.Offset(, 1) = Target
End With
'destroy object
Set DestSheet = Nothing
End If
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules