Email Single Sheet as Pdf

lizemi

New Member
Joined
Sep 5, 2021
Messages
25
Office Version
  1. 365
Platform
  1. Windows
I have a worksheet containing 43 sheets.
This is my monthly Invoices to clients
I need to email my invoices in Pdf
So it has to email that single sheet in pdf to the email on that sheet not the whole worksheet
Email address in cell b6
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Maybe
Rich (BB code):
Sub Send_Email()
    Dim wPath As String, wFile As String
    
    wPath = ThisWorkbook.Path
    wFile = "Filepdf.pdf"
    activesheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPath & wFile, _
        Quality:=xlQualityStandard, IncludeDocProperties:=True, _
        IgnorePrintAreas:=False, OpenAfterPublish:=False


    Set dam = CreateObject("Outlook.Application").CreateItem(0)
    '
    dam.To = "email@gmail.com"
    dam.Subject = "email subject"
    dam.Body = "email body"
    dam.Attachments.Add wPath & wFile
    dam.Send
    MsgBox "Email sent"


End Sub
 
Upvote 0
Thanks how so i tell it that the email is in cell b6
 
Upvote 0
I was able to tell it that the email address is in cell b6 so that works
My problem is that if i select all sheets and run the macro it sends all the invoices to everyone instead of only their invoice. So I will have to go to each sheet and run the macro resulting in me having to run the macro 40 times
 
Upvote 0
Are there sheets to be excluded from the list of emails ?
AND
What is the range of cells that make up the invoice ?
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,927
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top