View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default VBA code for Timestamp

Launch VBE using Alt+F11. From the left treeview double click Sheet1. From
drop down select Worksheet Change and paste the code so as look as below...

Try in Sheet1 ColA

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("$A:$A")) Is Nothing Then
Range("B" & Target.Row) = Now()
End If
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Guntars" wrote:

Gentlemen,
I am new to VBA, what I am trying to achieve is, for example when I enter a
text in cell A1 I want VBA script automatically put timestamp in a cell B1
and so on. There will be more text added later in column A, and I always want
the timestamp to appear right next to it, in column B.
I hope somebody will be able to help me, and also explain the steps how its
done.

Thank you,
Guntars