How to get the current date in Excel
The following article summarizes the commonly used ways to get the current date in Excel.
Method 1: Use the TODAY () function
Step 1: In the cell to get the current date value enter the command = TODAY () .
Step 2: Press Enter to get the results:
Step 3: Copy the formula for the remaining cells to get the result:
Method 2: Use the shortcut key combination Ctrl +;
Step 1: Place the cursor in the cell to enter the current date value.
Step 2: Press the key combination Ctrl + ; -> Current date value displayed.
Step 3: Similar to operating with the remaining cells to get results:
Method 3: Use a VBA statement.
Step 1: Press the key combination Alt + F11 to open VBA window. Enter the command as shown:
Step 2: Save the newly created VBA file and exit the VBA. During the process of saving will be notified you click OK . Continue to press Alt + F11 to open VBA window and enter the following code:
Note: In this worksheet, perform from line A3 to line A21.
Private Sub Worksheet_Change (ByVal Target As Range)
Dim C11 As Range
If Intersect (Target, [A2: A21]) Is Nothing Then Exit Sub
For Each C11 In Intersect (Target, [A2: A21])
If IsEmpty (C11) Then
C11 .Offset (, 1) .ClearContents
Else
C11.Offset (, 1) = Date
End If
Next
End Sub
Private Sub Worksheet_Change (ByVal Target As Range)
Dim Cll As Range
If Intersect (Target, [A2: A6000]) Is Nothing Then Exit Sub
For Each Cll In Intersect (Target, [A2: A6000])
If IsEmpty (Cll) Then
Cll .Offset (, 1) .ClearContents
Else
Cll.Offset (, 1) = Date
End If
Next
End Sub
Step 3: Finally, you exit VBA and go back to the excel file you want to create automatically. Here when you enter data in column A, the current date is automatically entered into the corresponding cell on column B. So, when you enter the item data, the date entered is the current date entered automatically. to the Import date column .
Note: You can change the scope of data entry by modifying statements in the event Change of Worksheet .
Above are the basic ways to enter current date in excel. Depending on the work you choose for yourself the most reasonable way.
Good luck!
You should read it
- Instructions on how to insert the current date in Excel
- Quickly insert current date and time into a cell in Excel
- NOW function - The function returns the current date and time in Excel
- How to fix the date #VALUE error in Excel
- How to fix date errors when copying to another Excel file
- Current date and time in Python
- TODAY function - The function returns the current date value in the format in Excel
- The date command in Windows
- Instructions on how to fix reverse dates in Excel
- How to fix date format errors in Excel
- Change the slash to a dot in Excel format
- DATE function - The date function in Excel
May be interested
Group in Word, group of image blocks in Word
BETADIST function - Cumulative distribution function Beta in Excel
TTEST - Returns the probability associated with a Student's t-Test in Excel
ZTEST function - Returns the probability value on one side of the z test in Excel
VAR function - The function of estimating variance based on a sample in Excel
VARP function - Functions for calculating variance based on an entire population in Excel