BrendanDixon
Board Regular
- Joined
- Mar 7, 2010
- Messages
- 174
- Office Version
- 365
- 2019
- Platform
- Windows
Hi All
I want to create a macro that will send a PDF copy of the workbook via email. I tried recording a macro, but when running the macro it does not replicate what I did when recording it/ I want the file as a PDF but when running the code is adds a XLSX file and anyone help
I wouls also like to have the email address automatically filled in from a value in a cell:
I want to create a macro that will send a PDF copy of the workbook via email. I tried recording a macro, but when running the macro it does not replicate what I did when recording it/ I want the file as a PDF but when running the code is adds a XLSX file and anyone help
I wouls also like to have the email address automatically filled in from a value in a cell:
Code:
Sub Sendmail()
Dim FName As String
FName = "C:"
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=(FName & "\" & Sheets("Lists").Range("H2").Value & " " & Sheets("Lists").Range("G2").Value & ".pdf"), Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Application.Dialogs(xlDialogSendMail).Show
End Sub