I have a macro that creates an outlook session and creates an email with a distribution list I only want to send the summary sheet of the workbook not the whole workbook
How do i copy one sheet into the body of an email?
I have a macro that creates an outlook session and creates an email with a distribution list I only want to send the summary sheet of the workbook not the whole workbook
How do i copy one sheet into the body of an email?
If you only wish to send one Worksheet from a Workbook you can use the method shown below. It creates a new Workbook housing ONLY the sheet that copy. It then sends the 1 sheet Workbook as an attachment, then closes the new Workbook without saving.
HTHSub Send1Sheet_ActiveWorkbook() 'Create a new Workbook Containing 1 Sheet _ and sends as attachment. With ActiveWorkbook .Sheets(1).Copy .SendMail Recipients:="dump@vbaexpress.com", _ Subject:="Try Me " & Format(Date, "dd/mmm/yy") .Close SaveChanges:=False End With End Sub
ilyaskazi
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Had already thought of that as a fall back option.
I can copy the page to the clipboard using:
Range("a1:d11").CopyPicture xlScreen, xlBitmap
I just dont know how to them copy it down from the clipboard to the body of the email
Manually... click File > Send To, leave the option "Send the current sheet as the message body" checked, then click OK...
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Anybody know the vba code to do this - when i record i get nothing
To do what? If you're referring to my last post, follow the link in my first post.
If you're referring to copying from the clipboard to the body of the email - there's no need, Excel has the built-in functionality to do this without a copy-paste
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Sorry - missing something here
I can do the send the current sheet as the body of an email manually by following the menu path as click File > Send To, leave the option "Send the current sheet as the message body"
But i need to do this as vba code
????? Can't you read? I'll assume you don't know how to scroll back up the page....Originally Posted by Kippers
Click >> HERE << to get your code
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.