Combining 2 HTML files into a Single Workbook

  • Thread starter Thread starter Greg Griffiths
  • Start date Start date
G

Greg Griffiths

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 ?
 
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
 
Back
Top