|
|
Question : Excel macros sending file with different name
|
|
I have a macro that sends selected data from a spreadsheet to a series of email addresses. That works fine but the emails that are sent out always have the same subject and the attached file has the same name each time. What I need is the macro to add the contents of a specific cell into the subject line and also save the file with a name also containing the cells contents so that each days file and email are easily identified.
REX
|
Answer : Excel macros sending file with different name
|
|
save as using value of A1 cell in active sheet and send mail without start dialog code:
Sub Makro3() ActiveWorkbook.SaveAs Filename:=ActiveSheet.Cells(1, 1).Value, _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Application.sendmail "[email protected]; second", Cells(1, 1).value End Sub
separator of recipients maybe can be different as ; but it is correct in my system
|
|
|
|
|