In case you want a VBA code to automatically record date & time stamp in a specific cell & insert date & time stamp based on the changes in other cell, then this article is for you.
In this article, we will learn how to insert Date & Time Stamp, using vba coding.
Question): I want to add date & time stamp in cell B2 through vba code when I enter anything in cell A2.
In order to get date & time stamp, using vba code, we need to follow the below steps to launch VB editor
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 2 Then
If Target.Value = “” Then
Cells(2, 2).Value = “”
Cells(2, 2).Value = Format(Now, “mm/dd/yyyy HH:mm:ss”)
In this way, we can insert date & time stamp using vba in Microsoft Excel 2010.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.