Paste html into Excel 2010 without Excel parsing the html

9

1

I'm running a query on SQL. Typically I can easily copy and paste the results from the query into Excel and it preserves the columns, rows etc.

However, in this case I'm selecting a bunch of emails and the bodies of those emails are html formatted. Every time I try and paste into Excel 2010, it completely messes it up since it's trying to be 'helpful' by parsing the html and converting img tags to images and table cells to Excel cells etc.

Is there some way I can have Excel be dumb and just paste my text without trying to figure out something clever to do with it?

I've tried using Paste Special. I've tried prepending a single quote to the start of the html body (someone said that tells Excel to treat the field as text and not parse it). I tried putting pipes | between each column, saving it to a text file and then importing the text file. No matter what I do, Excel keeps messing with the html.

Does anyone know how to paste html into Excel as just plain 'ol dumb text?

merk

Posted 2013-05-16T23:43:14.767

Reputation: 253

Try unchecking all the delimiter options in the Data / Text-to-Columns dialogue box. – chuff – 2013-05-17T01:00:41.170

If you mean in the wizard, already tried that. Besides, it's clearly not a delimiter issue. It's very obviously parsing the html. And As i said, it'll display <img> tags as the actual image. splitting up table cells into excel cells. So it's definitely trying to do something clever with the html. I just want it to paste everything as text and not try and do anything 'helpful' for me. – merk – 2013-05-18T01:37:11.513

Did you also check the 'Text' option in Step 3 of the Text Import Wizard? – Jerry – 2013-05-22T15:36:22.060

Yes i did, had no effect – merk – 2013-05-23T19:03:04.917

1Did you ever find a solution for this? I am trying to do this exact thing now! – franglais – 2014-06-03T11:54:21.097

This was a while ago - i dont actually remember what the outcome was, sorry. – merk – 2014-06-05T02:15:03.203

Answers

8

I figured it out!!!!

Try DOUBLE CLICKING in the cell to which you want to paste (rather than simply selecting the cell with a single click). Your paste option should then switch to text and NOT parse the text data.

Jennifer

Posted 2013-05-16T23:43:14.767

Reputation: 81

2this was a while ago - i'll try this next time although if i remember correctly this wouldn't have been much help for me since i was pasting multiple records. Having to paste each cell one at a time would have been very unpractical – merk – 2014-08-14T22:18:13.973

5

Select the HTML, paste as Keep Text Only in to a new Word document, then Select All, Copy. Then when you right-click in Excel you have a Match Destination Formatting option, which is not available through the expected route. Slightly less tedious than saving as a separate file, but still a workaround that you shouldn't have to do.

Richard

Posted 2013-05-16T23:43:14.767

Reputation: 51

I didn't expect this to work, but it does. Or at least, it worked for me. This is a better solution than the top because it supports an entire resultset instead of just a single field. – bambams – 2019-07-19T20:08:45.060

1

User [daverunt] on Mr. Excel Forums gave this answer.

It may not be applicable in all situations, because you have to save it to a ".txt" file, but it was the quickest way I could get around the problem when I had the same issue as in the original post. Mainly, in one step, it will prevent the HTML-interpretation of all your lines of text.

I think the best way is to save it in a text file.
In Excel select File Open.
Select Delimited then next
Un-tick all delimiter selections then Next
Text then Finish

Mark Goldfain

Posted 2013-05-16T23:43:14.767

Reputation: 111

Thanks for the edits, G-Man. And by the way ... superb avatar. – Mark Goldfain – 2015-05-03T03:29:48.627

or just save as .csv (comma separated values) and double click it (or drag and drop it in Excel). If any issues with commas, save as .txt (tab separated values) and drag and drop the file in Excel – Slai – 2017-12-05T12:56:16.697

0

Note a shortcut to do this is to copy the marked up text, select the cell, then use the F2 keyboard shortcut. This has the same effect as double clicking in the cell or clicking in the text entry bar at the top of the screen, it will bring the cursor into the cell and allow you to edit the text.

This is a standard windows shortcut to edit whatever is selected. It also works for renaming files in explorer.

Steve Deslandes

Posted 2013-05-16T23:43:14.767

Reputation: 1

The question is looking for a solution where the html links would not be parsed and be clickable. It is not on how to edit a link – Prasanna – 2016-04-15T10:42:11.547

0

paste it in google spreadsheet, then again copy and paste it in your excel sheet. It will show as code/text not html value

Ibrahim Akbar

Posted 2013-05-16T23:43:14.767

Reputation: 1

There is a feature within Excel where you can indicate the paste operation should just be plain text. Using Google Spreadsheets is an extra step that isn't needed. – Ramhound – 2016-07-21T21:55:21.030

I have not seen it bro.. which version of excel you see this? – Ibrahim Akbar – 2016-07-30T20:34:42.073

Every version of excel I have used since 2003 – Ramhound – 2016-07-30T21:18:18.763

0

I managed to do this very easily after searching around.

Copy the text from the source under File and the paste option you have the chance to open the text wizard and (as stated above) simply use the delimited option and then deselect all delimiters and finish.

The data will be copied unformatted and no need to save as text file first

user767573

Posted 2013-05-16T23:43:14.767

Reputation: 1

0

I found that the answer given by Mark Goldfain works without the step of saving as a text file.

Just paste the text. Look for the Paste Options button and click it. Click “Use Text Import Wizard …”. The pasted text disappears and the wizard comes up. Choose delimited, but unselect all delimiters! Select “Text” data type.

Weird work-around, but it works (in Excel 2007 under Windows 7).

NewSites

Posted 2013-05-16T23:43:14.767

Reputation: 335