How to Import HTML into Excel (3 Easy Ways)

Download the Practice Workbook


Method 1 – Use the Data Tab to Import HTML from Existing Connection

  • Save an HTML file on your PC.
  • Open an Excel file, go to the Data tab, and select Existing Connections from the Get & Transform Data group.

select existing connection option

  • The Existing Connections box will appear.
  • Select Browse for More.

click on Browse for more

  • The window for selecting files will open.
  • Select the HTML file and press the Open button.
  • We selected an HTML file named List of lakes by area from Wikipedia, which was saved on our PC.

opening saved html file

  • The New Web Query window will open, showing the contents of the HTML file.
  • You will see a red arrow sign on a yellow box at the top left side of each table.
  • Scroll the content, search for the table you want to import, and click on the arrow sign at the top left. It will change into a tick mark.
  • Press the Import button.

select table from new web query

  • The Import Data message box will appear.
  • Select New worksheet if you need the table to import in a new sheet. Otherwise, insert a cell reference in the Existing worksheet section. We inserted the cell reference A1 in the existing worksheet.
  • Hit OK.

press ok

  • You can see the table imported in your Excel file.
  • Add table styles or edit it how you want.

html imported to sheet


Method 2 – Import HTML from the Web Directly

  • Select the link you want to import data from in your browser and copy it by pressing Ctrl + C.

Copy the Table in Web page to import

  • Open an Excel file, select Get Data from the Data tab, click From Other Sources, and select From Web.

Selecting from web from get data option

  • Alternatively, select From Web from the Get & Transform Data group in the Data tab.

Click From Web option

  • The From Web box will appear.
  • Paste the copied link by pressing Ctrl + V in the URL section and press OK.

paste the web link

  • A Navigator window will appear, where you can see all the available tables in HTML displayed on the right side.
  • Select multiple items at once by checking the check box Select multiple items.
  • Choose the tables you need and press Transform Table to open the Power Query Editor. You can also press the Load button to import the table immediately without editing it.

Selecting table from navigator box

  • We opened the Power Query Editor.
  • Press Use First Row as Headers if you want the first row as headers.
  • Make other changes as needed.
  • Press Close & Load to import the table into the worksheet.

Close and load the query

  • The table will be imported into an Excel sheet.

table added to Excel


Method 3 – Apply the Import Option to Import HTML into Excel (Only for Mac)

This method is only applicable to Excel 365 and Excel 2016 and newer for Mac.

  • Select the Import option in the File tab.
  • A dialog box named Import will appear.
  • Choose the type of file you want to import and press the Import button.
  • The Choose a File dialog box will appear.
  • Select the HTML file you want to import and click Get Data.
  • Specify how you want to divide the text into columns and other formatting options in the Text Import Wizard.
  • You can set query definition, data layout options, and refresh control by clicking the Properties option in the Import Data box.
  • Press OK to finish. You will be returned to the Import Data dialog box.
  • You can choose the option of importing data to an Existing or New worksheet and press OK.

Frequently Asked Questions

How to open an HTML file in Microsoft Excel?

Go to the File tab, select Open, click the Browse option, select the HTML file you want to open, and press Open.

How do I import a web page into Excel?

Select the From Web option from the Data tab, insert the URL, and click Connect to select and import web data.

How do I convert HTML to readable text?

Copy the web page text by selecting and pressing Ctrl + C and paste it by pressing Ctrl + V into a text document.

Get FREE Advanced Excel Exercises with Solutions!
Priti
Priti

Priti Halder holds a BSc degree in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology. She has been a part of the ExcelDemy project for 6 months and during this time, she has written over 30 articles and 5 comments for the platform. Priti is currently employed as an Excel and VBA content developer and provides effective solutions to various Excel-related issues. She is passionate about expanding her knowledge of data analysis and Microsoft... Read Full Bio

2 Comments
  1. Hi Priti,

    I found this article extremely helpful. Thank you. Regards

    • Hello Adnan,

      You are most welcome. We are glad to hear that you found this article extremely helpful. Keep learning Excel with ExcelDemy!

      Regards
      ExcelDemy

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo