Dears contributors,
I would like to automatically download content from a website and place it to excel.
I have already created a code with a prompt box to extract the content from the web.
What i would like to do now, without success after many tries, is to select only the second row of the web content. On top, i would like to replace the content in the excel each time i refresh my query.
Please see below my current code for information. Many thx in advance for any advice.
Sub URL()
'
' URL Macro
'
Dim dt_begin As String
Dim olivier As String
dt_begin = InputBox("Give begin date", "date", "1")
olivier = dt_begin
Range("E2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://wuki.vw.vwg/jctwukip/WuKI/k-dtk/jsp/zinstabellen/detailzinstabelle.jsp?CCYID=130&begin=" & dt_begin & "&ende=" & olivier & "&titel=A2-B2&lang=en" _
, Destination:=Range("$G$1"))
.Name = "31&titel=A2-B2&lang=en"
.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 = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub