ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combining 2 HTML files into a Single Workbook (https://www.excelbanter.com/excel-programming/291103-combining-2-html-files-into-single-workbook.html)

Greg Griffiths

Combining 2 HTML files into a Single Workbook
 
I've got two HTML files containing tables - output of Business Objects -
and I need to put them into the same workbook - on different worksheets
- will all the formatting that they currently have, any ideas ?


Dick Kusleika[_3_]

Combining 2 HTML files into a Single Workbook
 
Greg

You should be able to open them as their own separate workbooks, then copy
one sheet over to the other.

Sub TwoHTML()

Dim wb1 As Workbook
Dim wb2 As Workbook

Set wb1 = Workbooks.Open("C:\Dick\Table 1.html")
Set wb2 = Workbooks.Open("C:\Dick\Table2.htm")

Dim sh As Worksheet

wb1.Sheets(1).Copy wb2.Sheets(1)

wb1.Close False

End Sub


--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Greg Griffiths" wrote in message
...
I've got two HTML files containing tables - output of Business Objects -
and I need to put them into the same workbook - on different worksheets
- will all the formatting that they currently have, any ideas ?





All times are GMT +1. The time now is 01:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com