VBA & Macro Problems

Fix Excel VBA Sending the Same Email to Every Recipient

Rana GarciaRana Garcia Nov 18, 2026 869 views

Question details

The user needs an Excel VBA macro to create separate emails with the recipient and subject from each qualifying row.

Fix Excel VBA Sending the Same Email to Every Recipient
Product
Microsoft Excel VBA and Microsoft Outlook
Device & OS
not provided
Scenario
A macro checks spreadsheet dates and prepares an individual email for each matching row.
Observed behavior
The macro repeatedly uses the first matching recipient and the same subject instead of the values from each row.
Before you start

Identify the worksheet and columns containing the date, recipient, and subject, and decide which date should qualify a row. The example below uses classic Outlook for Windows and displays messages for review rather than sending them immediately.

Solution 1Recommended

Create a New Outlook Email for Each Matching Excel Row

Use the current row to populate each message and create the Outlook email inside the loop.

The example assumes dates are in column A, email addresses are in column B, and subjects are in column C. It matches today's date and ignores the time portion. Adjust the worksheet, columns, or date condition to suit your workbook.

1
Open the VBA editor

In Excel for Windows, press Alt+F11, then open the module containing your email macro or choose Insert > Module.

2
Update the email loop

Adapt this example to your workbook. It creates a new message and reads the recipient and subject inside the loop: Sub PrepareIndividualEmails() Dim ws As Worksheet Dim outlookApp As Object Dim mail As Object Dim lastRow As Long Dim r As Long Set ws = ThisWorkbook.Worksheets("Sheet1") Set outlookApp = CreateObject("Outlook.Application") lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row For r = 2 To lastRow If IsDate(ws.Cells(r, "A").Value) Then If DateValue(ws.Cells(r, "A").Value) = Date Then If Trim(ws.Cells(r, "B").Value) <> "" Then Set mail = outlookApp.CreateItem(0) With mail .To = ws.Cells(r, "B").Value .Subject = ws.Cells(r, "C").Value .Body = "Hello, please review this message." .Display End With Set mail = Nothing End If End If End If Next r End Sub

3
Review the messages

Run the macro from the VBA editor with F5. Check each displayed Outlook message to confirm its recipient and subject match the corresponding worksheet row.

4
Send after testing

Once the results are correct, send the displayed messages manually, or replace .Display with .Send in the VBA editor to send future messages automatically.

Create a New Outlook Email for Each Matching Excel Row
Check the row references: If your existing code stores the recipient or subject before the loop, move those assignments inside it. Also check that the loop uses its current row variable rather than a fixed cell or the first matching row.
Free Microsoft Office alternative

Review Your Email Recipient List in WPS Spreadsheet

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Excel workbooks. Its format compatibility makes it easy to move spreadsheet data between office suites, although it does not fix Excel's VBA or Outlook automation.

Review date, recipient, and subject columns in WPS SpreadsheetOpen and edit Microsoft Excel XLS and XLSX filesUse a familiar spreadsheet interface for an easier transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does my macro keep using the first recipient?

The recipient may be assigned before the loop or read from a fixed cell. In the VBA editor, check that the .To value is taken from the current loop row for every qualifying record.

How do I give each email a different subject?

Inside the loop, set .Subject from the current row's subject cell, such as ws.Cells(r, "C").Value. Change column C if your subjects are stored elsewhere.

How can I test the macro without sending emails?

Use .Display instead of .Send on each Outlook mail item. Run the macro in the VBA editor and inspect the recipient and subject in each open message.

What if a matching date also contains a time?

Compare the date portion with DateValue, as in DateValue(ws.Cells(r, "A").Value) = Date. Check the cell with IsDate first to avoid errors from invalid entries.

Will this Outlook example work in every version of Excel?

The example uses Outlook desktop automation with CreateObject and is intended for classic Outlook on Windows. Other platforms or Outlook versions may require a different approach.