Zde dávám ten kod:
Sub import_cyklus()
Dim i As Long, Sloupec As Long
Sloupec = 1 'sloupec E
For i = 2 To Worksheets("UVOD").Cells(1000000, Sloupec).End(xlUp).Row
ActiveWorkbook.Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = "tým " & Worksheets("UVOD").Cells(i, Sloupec)
With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.peloton.cz/soutez?tym=" & Worksheets("UVOD").Cells(i, Sloupec), Destination:=Range("$A$1"))
.Name = "soutez?tym=" & Worksheets("UVOD").Cells(i, Sloupec)
.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
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next i
End Sub
Co mám změnit, aby to fungovalo tak jak jsem psal výše?citovat
Sub import_cyklus()
Dim i As Long, Sloupec As Long
Sloupec = 1 'sloupec E
For i = 2 To Worksheets("UVOD").Cells(1000000, Sloupec).End(xlUp).Row
ActiveWorkbook.Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = "tým " & Worksheets("UVOD").Cells(i, Sloupec)
With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.peloton.cz/soutez?tym=" & Worksheets("UVOD").Cells(i, Sloupec), Destination:=Range("$A$1"))
.Name = "soutez?tym=" & Worksheets("UVOD").Cells(i, Sloupec)
.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
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next i
End Sub
Co mám změnit, aby to fungovalo tak jak jsem psal výše?citovat