Add a Selected Row Name to an Outlook Email Subject with Excel VBA
Question details
Add the value in column A of the currently selected Excel row to an Outlook email subject created by a VBA macro.

- 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.
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.
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.
In Excel, open the Developer tab and select Visual Basic, then open the module containing your email macro.
Find the line that assigns NewEmailItem.Subject and replace it with: NewEmailItem.Subject = "Message for " & ActiveSheet.Range("A" & ActiveCell.Row).Value
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.

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.

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.




