General Information

When scanning a sample, the "Sample ID" is automatically entered into column "C" of the work sheet. A change in column "C" causes a macro to enter the date and time into column "D".
Should you have any problem with these dates and times, then these following instructions might become handy.

Checking the Macro

The heart of the process is the following macro:
	Option Explicit

	Private Sub Worksheet_Change(ByVal Target As Range)
    	   If Target.Column = 3 Then
               Application.EnableEvents = False
               Target.Offset.Offset(0, 1) = Now()
               Application.EnableEvents = True
            End If
	End Sub
This macro must be available to all the work sheets that need it. To check whether the macros are present, open the Visual Basic Editor thus:

The window below will be displayed. In the "Project" panel, encircled in green, double click on the work sheet that gives you problems and make sure the macro is showing in the code panel to the right.
Should the macro be missing you can "Copy" it from above ("Option Explicit etc.") and "Paste" it into the code panel.


  1. Column "D" does not need to contain any information for the macro to work. It is actually better to leave it blank because should it contain formulas such as: "=IF(ISTEXT(C2), NOW(), " ")" or "=IF(ISTEXT(C2), TODAY(), " ")" the system would seem to work even without the macro and the formulas would be saved instead of the dates and times, which would cause the dates and times to unexpectedly change following the formulas.
  2. Fixing the problem will not fix previously scanned erroneous data, only the new data.

2009 February 25
Last updated 2009 February 25