How to Automatically Enter Date When Data is Entered in a Column in Excel?


Have you considered whether Excel can automatically record the date of the value entered in the sheet? This can be done in Excel by applying this uncomplicated process to the sheet. For example, if you want to list the main events that occurred on a given day, you can directly enter the name of the event and the date will be generated automatically. This can save you a lot of time as there is no need to enter the date every time, and this cannot even completely use the auto-fill handle because the number of values will be unique and random. This tutorial will help you understand how we can automatically enter dates when data is entered in a column.

Automatically Enter Date When Data is Entered in a Column

Here we will insert VBA code for the sheet to complete our task. Let us see a straightforward process to understand how we can automatically enter dates when data is entered in a column. We need to use the help of a VBA application to complete our process; it cannot be done directly in Excel.

Step 1

Consider creating a new Excel sheet and right-clicking on the sheet name to open the VB application, then typing the programme into the text box as shown in the image below.

Example

Private Sub Worksheet_Change(ByVal Target As Range) 'Updated By Nirmal If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target, Range("A2:A15")) Is Nothing Then With Target(1, 2) .Value = Date & " " & Time .EntireColumn.AutoFit End With End If End Sub

Step 2

Now save the sheet as a macro-enabled template and close the VBA application using the command "Alt + Q"; then, every time we enter the data in cells of column "A", the date will be shown in column "B".

Conclusion

In this tutorial, we used a simple example to demonstrate how we can automatically enter dates when data is entered in a column in Excel.

Updated on: 10-Jan-2023

518 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements