ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loop .WebTables to increment by 1 (https://www.excelbanter.com/excel-programming/354264-loop-webtables-increment-1-a.html)

al007

Loop .WebTables to increment by 1
 
Sub Extracttable()
'

ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _

"URL;file:///D:/group2005/group2005.htm",Destination:=Range("A1"))
.Name = "srlgroup2005"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

How can i amend the above code to increment .WebTables by 1 - to say 20
to
extract all 20 tables in the file
Thxs



All times are GMT +1. The time now is 02:21 PM.

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