VBA & Macro Problems

Insert a Static Date with Excel VBA Instead of TODAY

Natalie TaylorNatalie Taylor Dec 2, 2026 868 views

Question details

Insert the current date as a fixed value when an Excel macro button is pressed.

Insert a Static Date with Excel VBA Instead of TODAY
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.
Before you start

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.

Solution 1Recommended

Write the Current Date as a VBA Value

Use the VBA Date function instead of a TODAY formula to keep each inserted date fixed.

1
Open the macro

In Excel, select Developer > Visual Basic, then open the module containing the button's macro.

2
Replace the formula

Find the line ActiveCell.FormulaR1C1 = "=TODAY()" and replace it with ActiveCell.Value = Date. Make sure ActiveCell is the intended destination when this line runs.

3
Format the date

Optionally add ActiveCell.NumberFormat = "mm/dd/yyyy" immediately after the value assignment to display the date in month/day/year format.

4
Test the button

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.

Write the Current Date as a VBA Value
Existing formulas are unchanged: This change affects future entries. To freeze existing TODAY formulas at their currently displayed dates, select those cells, copy them, and use Home > Paste > Values. This cannot recover their original insertion dates.
Free Microsoft Office alternative

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.

Enter fixed dates as cell values in WPS SpreadsheetsOpen and edit Microsoft Excel XLSX filesUse a familiar spreadsheet interfaceGet a free, lightweight office suite
microsoft office alternative - wps office

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.