[問題] EXCEL VBA 將網址修改成有變數
軟體 : EXCEL VBA
版本 : Office 2013
請問大家, 我想要將巨集錄製完成的股市下載程式碼, 裡面含有網址的部分
修改成儲存格變數, 讓我可以在指定的儲存格修改資料,
但是就是不會修改網址的部分, 請大家幫忙看一下
想將網址內的三個地方變成儲存格變數:1.股票代號 2.起始日期 3.結束日期 如下
1. 1101
2. 2017/01/01
3. 2017/03/28
請問可以怎麼修改呢?感謝
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://www.cnyes.com/twstock/ps_historyprice.aspx?code=1101&ctl00$ContentPlaceHolder1$startText=2017/01/01&ctl00$ContentPlaceHolder1$endText=2017/03/28" _
, Destination:=Range("$H$2"))
'.CommandType = 0
.Name = "28"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = "1"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=True
End With
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.120.41.52
※ 文章網址: https://www.ptt.cc/bbs/Office/M.1519970721.A.6D9.html
→
03/02 14:09,
8年前
, 1F
03/02 14:09, 1F
→
03/02 14:17,
8年前
, 2F
03/02 14:17, 2F
→
03/02 14:17,
8年前
, 3F
03/02 14:17, 3F
→
03/02 14:17,
8年前
, 4F
03/02 14:17, 4F
→
03/02 14:17,
8年前
, 5F
03/02 14:17, 5F
→
03/02 14:21,
8年前
, 6F
03/02 14:21, 6F
→
03/02 14:22,
8年前
, 7F
03/02 14:22, 7F
→
03/02 14:29,
8年前
, 8F
03/02 14:29, 8F
→
03/02 14:31,
8年前
, 9F
03/02 14:31, 9F
→
03/02 14:32,
8年前
, 10F
03/02 14:32, 10F
→
03/02 14:32,
8年前
, 11F
03/02 14:32, 11F
→
03/02 14:34,
8年前
, 12F
03/02 14:34, 12F
→
03/02 14:34,
8年前
, 13F
03/02 14:34, 13F
→
03/02 14:39,
8年前
, 14F
03/02 14:39, 14F
Office 近期熱門文章
PTT數位生活區 即時熱門文章