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
- 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
May be interested
- How to fix date format errors in Excelyou are new to excel and there are many strange problems. you are reversed the date format in excel. so how to fix this.
- Change the slash to a dot in Excel formatby default, the excel date format often uses slashes, such as march 23, 2016 .... however, if your worksheet has multiple dates lists, you can use dots. in date format to make the worksheet easier to see, no glitches.
- DATE function - The date function in Excelthe date () function returns a date that is formatted corresponding to the date entered as based on the date index.
- Reveal the secret for importing and converting date formats in Exceleach type of date format you feel very picky and wordy. you find it annoying to have to enter that format.
- How to automatically update the Excel file editing timewhen inserting and editing time excel file, you will control the latest time to edit the file if shared with many people.
- Calculation of age from date of birth in Excelthe following article will guide you how to calculate the age from date of birth in excel so you can calculate the exact number of standard age in years, months and days. in the process of calculating age based on date of birth, the following cases occur: - case 1: calculates the usual age
- How to convert a sequence of numbers into dates in Excelon excel, we can convert the sequence of numbers into dates without manually entering data.
- Excel date function - Usage and examplesthe date counting function in excel is one of the most effective functions of this software. because excel usually works in the field of statistics and calculations, it is extremely necessary to record dates. to help you understand this function, let's come to the following article of tipsmake.
- Macromedia Flash - Create current date and time notificationsin this lesson, you will learn how to create a file that announces the current date with flash. just use the given code to quickly create this file.
- How to format dates in Excel quickly and easilyinstructions for setting date format in excel 2019, 2016, 2013, 2010... in the article below, you can refer to it to shorten the time when entering date data used in excel.