How to copy a formatted Excel table into Gmail?

Solution 1:

Copying an Excel range results in css styled HTML when pasted into an email client. If you paste into Outlook, depending upon your settings, Outlook will handle the css styled HTML (and might even refactor it within the email).

But gmail won't honor css-styles that are defined in style-sheets or style tags, so the formatting is lost. gmail will honour most css if it is defined inline. i.e. the css for each element is defined in each element's HTML style attribute. You'd have to transform the Excel-range into inline-styled HTML, and get it onto the clipboard in order to succeed.

You have a few options:

  1. Copy from Excel, then Paste into Word, then Copy from Word and Paste into gmail. Your mileage may vary according to the complexity of the formatting, and the version of Excel/Word.

  2. Copy as a picture from Excel, and paste into gmail. You'll lose the textual content, but you should get a bitmap quality image of the source.

  3. Write some VBA to loop over the cells of the source range, and build up some inline-css HTML to make the table, and then put that string onto the clipboard. Warning - this will be quite involved, and even if you get things looking the way you like in gmail, the emails might not render properly in the recipient's email client/program.

  4. EDIT - You might also get acceptable results by copying from Excel, and pasting into Google Sheets, and then copying from Sheets into gmail.

You thought Browser standards were bad. Welcome to the world of Responsive Email Design.

Also, see CampaignMonitor for a good reference of email-client support for css

Solution 2:

Option 1:

Copy the contents to Google Sheets and then paste into Gmail.

Option 2:

Copy the contents to Word and then paste to Gmail.

Solution 3:

I found an easy solution. I signed into gmail using Outlook destkop as the client. Then I use Outlook to paste in the Pivot Table and send the email, the formatting is preserved. It even looks the same when I check on it in the Gmail web portal.