Insert a Static Date with Excel VBA Instead of TODAY
Question details
Insert the current date as a fixed value when an Excel macro button is pressed.

- Product
- Microsoft Excel VBA
- Device & OS
- not provided
- Scenario
- A macro adds a date to a new column when the user presses a button.
- Observed behavior
- Previously inserted dates change when the workbook recalculates because the macro inserts a TODAY formula.
Open the workbook in a desktop version of Excel that supports VBA, and identify the macro assigned to the button. Check that the macro selects or references the cell where the date should be inserted.
Write the Current Date as a VBA Value
Use the VBA Date function instead of a TODAY formula to keep each inserted date fixed.
In Excel, select Developer > Visual Basic, then open the module containing the button's macro.
Find the line ActiveCell.FormulaR1C1 = "=TODAY()" and replace it with ActiveCell.Value = Date. Make sure ActiveCell is the intended destination when this line runs.
Optionally add ActiveCell.NumberFormat = "mm/dd/yyyy" immediately after the value assignment to display the date in month/day/year format.
Return to the worksheet, select the intended destination if the macro uses the active cell, and press the button. Recalculate the workbook and confirm that the inserted date stays the same.

Work with Spreadsheet Dates in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility for an easy transition. You can enter fixed dates directly in WPS Spreadsheets, although it does not fix the VBA macro in Microsoft Excel.

Frequently Asked Questions
Why does TODAY change previously inserted dates?
The TODAY formula returns the current date and updates when the workbook recalculates. Use ActiveCell.Value = Date in the macro to insert a fixed value instead.
How do I format the inserted date?
After assigning the date, add ActiveCell.NumberFormat = "mm/dd/yyyy" in the VBA editor. You can also select the cell in Excel and choose a date format from Home > Number.
Will changing the macro fix dates already in the worksheet?
No. Existing TODAY formulas remain formulas. To freeze their current results, select and copy the cells, then choose Home > Paste > Values. Their original insertion dates cannot be recovered this way.
Can I insert the date into a specific cell instead of the active cell?
Yes. Replace ActiveCell with a specific worksheet range, such as Worksheets("Sheet1").Range("B2").Value = Date. Use the actual sheet name and destination cell in your workbook.




