我不知道如何从网站导入数据,我需要从2012年7月1日至今。任何想法家伙?我不知道如何做到这一点,因为URL更改。我想从2012年7月到现在导入所有数据,所以我可以通过网页的html源代码来完成这项工作吗?使用VBA代码从excel导入数据的网页不同日期使用VBA代码
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
如果URL,当你按日期筛选你能不能只使用新的URL在您的连接变化? – Rick
至少告诉我们这个URL每天的格式!它应该只是一个动态生成URL的问题。你想每天自动继续吗? –
它需要这样的:http://www.epexspot.com/en/market-data/intraday/intraday-table/2013-02-06/FR随着日,月,年的变化而变化。我想从2012年1月7日直到现在导入所有的数据。是的,理想的情况下,我会自动从2012年1月7日开始做这件事..任何想法@ElectricLlama tnx您的评论 – EyeShield21