VBA & Macro Problems

Excel VBA Macro to Set a Cell to Monday of the Current Week

Kushani NimanthikaKushani Nimanthika Nov 18, 2026 869 views

Question details

Calculate the Monday of the current week with a VBA macro and display it in cell C4.

Set a Cell to Monday of the Current Week with an Excel VBA Macro
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants a macro to put the current week's Monday date in a worksheet cell.
Observed behavior
The macro writes a weekday number directly to the cell, which displays as a date in January 1900.
Before you start

Open the workbook in a desktop version of Excel that supports VBA and identify the worksheet where cell C4 should be updated. Enable macros only if you trust the workbook.

Solution 1Recommended

Calculate Monday's Date in the VBA Macro

Use the current date and its weekday number to calculate Monday, then format C4 as a date.

Weekday(Date, 2) returns a number from 1 for Monday to 7 for Sunday. Subtracting that number from the current date and adding 1 gives the date of the current week's Monday.

1
Open the VBA editor

In Excel, select Developer > Visual Basic, or press Alt+F11 where available.

2
Add or edit the macro

In the VBA editor, open the existing macro or select Insert > Module and enter: Sub SetMonday() Range("C4").Value = Date - Weekday(Date, 2) + 1 End Sub

3
Run the macro

Return to the intended worksheet, select Developer > Macros, choose SetMonday, and select Run. The unqualified Range reference updates C4 on the active sheet.

4
Format the result as a date

Select C4, open Home > Number Format, and choose Short Date or Long Date.

Calculate Monday's Date in the VBA Macro
Save the macro: To retain the VBA code, select File > Save As and save the workbook as an Excel Macro-Enabled Workbook (.xlsm).
Free Microsoft Office alternative

Calculate the Current Week's Monday in WPS Spreadsheet

WPS Office is a free, lightweight Office alternative with a familiar interface and support for Excel workbook formats, making it easy to move spreadsheet work. In WPS Spreadsheet, you can calculate Monday with a worksheet formula instead of relying on an Excel VBA macro.

Calculate the current week's Monday with a TODAY and WEEKDAY formula.Open and edit Microsoft Excel formats such as XLSX and XLS.Use a familiar spreadsheet interface for a smooth transition from Excel.Work with a free, lightweight Office alternative.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my macro return a date in January 1900?

Weekday returns a number from 1 to 7, not a complete date. If the cell is formatted as a date, Excel displays that number as an early date serial. Calculate the date with Date - Weekday(Date, 2) + 1 instead.

Will the macro return today if today is Monday?

Yes. Weekday(Date, 2) returns 1 on Monday, so Date - 1 + 1 equals today's date.

How can I update C4 on a specific worksheet?

Qualify the range with the worksheet name, for example: ThisWorkbook.Worksheets("Sheet1").Range("C4").Value = Date - Weekday(Date, 2) + 1. Replace Sheet1 with the intended sheet name.

Can I calculate Monday without a macro?

Yes. Enter =TODAY()-WEEKDAY(TODAY(),2)+1 in C4 in Excel or WPS Spreadsheet, then use the Number Format menu on the Home tab to display it as a date.

Can I run this VBA macro in Excel for the web?

Excel for the web does not run VBA macros. Open the workbook in a desktop version of Excel to run the macro, or use the worksheet formula instead.