我试图下载马匹的数据表。用列中的值替换部分URL
宏中唯一的变量是URL的一部分。
我有列在“A”列出的所有变量(马编号)。
我想使用从网站收集的信息创建一个新工作表,然后使用列“A”中下一行的数字(新变量)再次收集信息。
到目前为止,这是我的代码:
Sub Makro1()
'
' Makro1 Makro
'
Dim nummer As String
nummer = Sheets("Ark1").Range("A1:A10")
'
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://195.198.34.45/trav/hast/visa/" & nummer & "/resultat", Destination:=Range _
("$A$1"))
.CommandType = 0
.Name = "resultat"
.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 = True
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Columns("D:D").Select
ActiveWindow.SmallScroll Down:=21
Columns("E:E").Select
Range("E22").Activate
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("D:D").Select
Range("D22").Activate
Selection.TextToColumns Destination:=Range("D1"), DataType:=xlDelimited, _
TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=True, Semicolon _
:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="/", _
FieldInfo:=Array(1, 2), TrailingMinusNumbers:=True
End Sub
User sheet trying to describe problem
我和你在一起,直到“然后在coulmn的下一行做”A“” - 你究竟是什么意思? – TheSilkCode
我想我试图创建一个多重查询。 多重查询的所有变量均以coulmn列出A –