VBA from MS Outlook to copy data from excel file and past it to email body

mrMadCat

New Member
Joined
Jun 8, 2016
Messages
35
Hi!

I have excel file which is saved locally in OneDrive folder but is shared within office 365 so can't use VBA.
So I need to run a macro from MS Outlook to copy data from the excel file and past it in the new email's body.
Here is the whole routine I want to automate:
1) Open the excel file
2) In the filter of the B column unselect "0" and empty cells
3) Select and copy filtered predefined range
4) Start new email with specified topic and contacts
5) past the previously copied data into the email's body as a table leaving the original formatting

Don't want to code this from scratch. Maybe you can point me to some similar examples I can use as a base.
Thank you.
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Dan_W

Active Member
Joined
Jul 11, 2018
Messages
254
Office Version
  1. 365
Platform
  1. Windows
Seems like we've got a lot in common; I don't want to code that from scratch for you either. That's a rather bespoke automation process you've outlined there, so I suspect that you'll need to break it down into its constituent components.

For item 1 ("open the excel file), check out this link.
For items 2 and 3, the answer by Scott should be helpful in terms of selecting non-blank cells: link.
For item 4, use the method at this link.
Finally, the answer for item 5 is amongst the answers here: link

Enjoy!
 

Watch MrExcel Video

Forum statistics

Threads
1,113,979
Messages
5,545,316
Members
410,676
Latest member
M0J0jojo
Top