我不知道如何从网站导入数据,从 2012 年 7 月 1 日到现在我都需要这样做。有什么想法吗?由于网址更改,我不知道该怎么做。我想导入自 2012 年 7 月至今的所有数据,我可以通过网页的 html 源来导入吗?
Sub websitee()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.epexspot.com/en/market-data/intraday", Destination:=Range( _
"$A$1"))
.Name = "intraday"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Union(Columns(3), Columns(4), Columns(5), Columns(7), Columns(8), Columns(9)).Delete
End With
End Sub