Share via

Excel - Insert date based upon adjacent cell content

Anonymous
2011-03-28T16:09:39+00:00

Is there a way to insert the current date (Now() or Today() ) based upon an update to the adjacent cell content.  (e.g. when data is added to the cell for the first time, another cell shows todays date).

I tried using the following: "=IF(A1="","",IF(B1="",NOW(),B1))" but this gives a circular reference error and does not work.  Funny, it worked fine in Excel 2003.

The idea is to track when a particular entry to the spreadsheet is made.

Windows XP, SP3, Office 2007

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-03-28T16:28:29+00:00

Hi,

That wouldn't have worked in E2003 it would give a circulare reference. Put this formula in B1

=IF(A1="","",NOW())

However, I don't think that what you want because it will update when Excel calculates. so try this macro. Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then Exit Sub

If Not Intersect(Target, Range("A1:A100")) Is Nothing Then

    Application.EnableEvents = False

        Target.Offset(, 1) = Now

    End If

    Application.EnableEvents = True

End Sub

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2011-03-28T17:12:26+00:00

    That works perfectly!  Thank you you for your help.

    Was this answer helpful?

    0 comments No comments