SAIMSKY ADMIN
asked on
How to import Multiply html files in one Excel file in different sheets
I have exported all my GPOs in html files , now I want to make one excel file of these html files. I want each GPO in each spread sheet.
Please advise
Please advise
ASKER
Can u plz guide me , I tired but still not able to doit, if u can guide me with the screen shots . Many thanks
ASKER
Thanks Glenn,
Actually I need all html files in one excel file.
Can you please guide me hoe to use marco, I found one marco but dont know to use in excel file.
Sub Pull_html()
Dim z As Long, e As Long
Dim f As String, m As String, n As String
Sheets("Sheet1").Select
Cells(1, 1) = "=cell(""filename"")"
Cells(1, 2) = "=left(A1,find(""["",A1)-1 )"
Cells(2, 1).Select
f = Dir(Cells(1, 2) & "*.htm")
Do While Len(f) > 0
ActiveCell.Formula = f
ActiveCell.Offset(1, 0).Select
f = Dir()
Loop
z = Sheets("Sheet1").Cells(Row s.Count, 1).End(xlUp).Row
For e = 2 To z
n = Sheets("Sheet1").Cells(e, 1)
If n <> ActiveWorkbook.Name Then
If Len(n) < 35 Then
m = Left(n, Len(n) - 4)
Else
m = Left(n, 31)
End If
Sheets.Add.Name = m
With ActiveSheet.QueryTables.Ad d(Connecti on:="URL;f ile:///" & Sheets("Sheet1").Cells(1, 2) & Sheets("Sheet1").Cells(e, 1), _
Destination:=Sheets(m).Ran ge("A1"))
.Name = "goodbites"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColu mns = True
.WebConsecutiveDelimitersA sOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
End If
Next e
MsgBox "collating is complete."
End Sub
Actually I need all html files in one excel file.
Can you please guide me hoe to use marco, I found one marco but dont know to use in excel file.
Sub Pull_html()
Dim z As Long, e As Long
Dim f As String, m As String, n As String
Sheets("Sheet1").Select
Cells(1, 1) = "=cell(""filename"")"
Cells(1, 2) = "=left(A1,find(""["",A1)-1
Cells(2, 1).Select
f = Dir(Cells(1, 2) & "*.htm")
Do While Len(f) > 0
ActiveCell.Formula = f
ActiveCell.Offset(1, 0).Select
f = Dir()
Loop
z = Sheets("Sheet1").Cells(Row
For e = 2 To z
n = Sheets("Sheet1").Cells(e, 1)
If n <> ActiveWorkbook.Name Then
If Len(n) < 35 Then
m = Left(n, Len(n) - 4)
Else
m = Left(n, 31)
End If
Sheets.Add.Name = m
With ActiveSheet.QueryTables.Ad
Destination:=Sheets(m).Ran
.Name = "goodbites"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColu
.WebConsecutiveDelimitersA
.WebSingleBlockTextImport = False
.WebDisableDateRecognition
.Refresh BackgroundQuery:=False
End With
End If
Next e
MsgBox "collating is complete."
End Sub
That macro looks okay; I could modify it and insert into a workbook so that you could browse to the folder with the files and then it would combine them. I will be away for an hour, but will work on this when I return.
-Glenn
-Glenn
ASKER
Many many thanks
ASKER
Hi Mate Glenn,
Can you please help me in this ?
Can you please help me in this ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many Many thanks Glenn, You are crack.
ASKER
Excellent work done, Super!!!!!
ASKER
Hi Glenn,
Many thanks , Need anther Marco setting , please if you can help me. I need to set hyperlink for html files in excel file. I have GPO html files in folder and in another excel file I have Summary of GPOs , what i want of I click on the name of GPO it will open html file of that GPO.
CH-HONGKONG_ACCOUNTS_USERS > CH-HONGKONG_ACCOUNTS_USERS ,html
Many thanks , Need anther Marco setting , please if you can help me. I need to set hyperlink for html files in excel file. I have GPO html files in folder and in another excel file I have Summary of GPOs , what i want of I click on the name of GPO it will open html file of that GPO.
CH-HONGKONG_ACCOUNTS_USERS
Hi Glenn,
Can you also import multiple html to single sheet on excel thank you. awesome work.
Can you also import multiple html to single sheet on excel thank you. awesome work.
If all your GPO files are in the same directory, a macro could be written to open each file and save on its own sheet in a new workbook.
-Glenn