VBA & Macro Problems

Add a Selected Row Name to an Outlook Email Subject with Excel VBA

Adam DavisAdam Davis Nov 18, 2026 870 views

Question details

Add the value in column A of the currently selected Excel row to an Outlook email subject created by a VBA macro.

Add a Selected Row Name to an Outlook Email Subject with Excel VBA
Product
Microsoft Excel VBA and Microsoft Outlook
Device & OS
not provided
Scenario
A user creates an Outlook email from Excel and wants its subject to include the name from the selected row.
Observed behavior
The email subject should combine a fixed phrase with the column A value from the active cell's row.
Before you start

Make sure your macro already creates an Outlook email item named NewEmailItem. Select a cell in the row whose column A value you want to use before running the macro.

Solution 1Recommended

Reference Column A of the Active Row in the Email Subject

Replace the fixed subject line with a reference to column A of the selected row on the active worksheet.

1
Open the VBA editor

In Excel, open the Developer tab and select Visual Basic, then open the module containing your email macro.

2
Update the subject line

Find the line that assigns NewEmailItem.Subject and replace it with: NewEmailItem.Subject = "Message for " & ActiveSheet.Range("A" & ActiveCell.Row).Value

3
Select the row and run the macro

Return to the worksheet, select a cell in the desired row, and run the macro from Developer > Macros. Check that the email subject contains the value from column A.

Reference Column A of the Active Row in the Email Subject
Use the correct worksheet: This line reads column A on the active worksheet. If the data is on a specific worksheet, activate that sheet and select the desired row before running the macro, or qualify the range with that worksheet and ensure the row number comes from the intended selection.
Free Microsoft Office alternative

Work with Excel Spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and compatibility with Microsoft Excel formats, making it easy to bring existing workbooks across. Excel VBA automation of Outlook may require Microsoft Excel and Outlook and should not be assumed to work in WPS.

Open and edit spreadsheet data used to prepare email lists.Work with Microsoft Excel formats such as XLSX and XLS.Use a familiar spreadsheet interface for a smoother transition.Access a free, lightweight office suite.
microsoft office alternative - wps office

Frequently Asked Questions

Which row does ActiveCell.Row use?

It returns the row number of the active cell. Select a cell in the desired row on the worksheet before running the macro.

How do I use a different column in the subject?

Change the column letter in the subject assignment. For example, ActiveSheet.Range("B" & ActiveCell.Row).Value reads the value from column B of the active row.

What happens if column A is blank?

The subject will contain the fixed text but no name after it. Check the column A cell on the selected row before running the macro.

How can I reference a specific worksheet?

Replace ActiveSheet with a qualified worksheet reference, such as ThisWorkbook.Worksheets("Sheet1"). Ensure the active row number refers to the intended row on that worksheet.