How do I lock a stamp date/time formula for an entry on a row?

G

Guest

I have a spreadsheet that is setup with Stamp Date/Time formula. I want each
row to be independent but every time I add an entry and save it, and move to
the next row and add another entry it changes the Stamp Date/Time formula on
all rows. How do I make it a true Stamp Date/Time spreadsheet so each row is
independent of the other?
 
G

Gord Dibben

Only by using VBA event code in the worksheet.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value <> "" Then
Excel.Range("B" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.

When you enter data in any cell in column A, a static date/time stamp goes into
column B on same row.


Gord Dibben MS Excel MVP
 
G

Guest

Thanks Gord but I am a newby to Excel. How do I use VBA? I am currently
using Excel 2002. So I am still learning the in's and out's of Excel.
 
G

Gord Dibben

Please read the part about "Right-click on the sheet tab" and onward.

The actual code to paste starts at Private Worksheet and goes to End Sub


Gord

Thanks Gord but I am a newby to Excel. How do I use VBA? I am currently
using Excel 2002. So I am still learning the in's and out's of Excel.

Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top