I need the subject name of the email to reflect a certain cell value,Sheets("Master Appraisal").Range("B65"), rather than the attachment name that goes with the email.
Below is the code that I have to email the saved name of the attachment as the subject:
Below is the code that I have to email the saved name of the attachment as the subject:
Code:
Sub Mail_workbook_1()
Dim wb As Workbook
Set wb = ActiveWorkbook
If Val(Application.Version) >= 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will" & vbNewLine & _
"be no VBA code in the file you send. Save the" & vbNewLine & _
"file first as xlsm and then try the macro again.", vbInformation
Exit Sub
End If
End If
On Error Resume Next
wb.SendMail "drmingle@***.com", _
ActiveWorkbook.Name
wb.SendMail Sheets("Master Appraisal").Range("F1"), _
ActiveWorkbook.Name
On Error GoTo 0
End Sub