- 帖子
- 19
- 主題
- 12
- 精華
- 0
- 積分
- 60
- 點名
- 0
- 作業系統
- XP
- 軟體版本
- Office 2007
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2011-9-27
- 最後登錄
- 2017-12-21
|
vba 網址問題
本帖最後由 ken759727 於 2013-7-26 11:28 編輯
- Range("A11").Select
- With ActiveSheet.QueryTables.Add(Connection:= _
- "TEXT;[color=Red]http://ichart.finance.yahoo.com/table.txt?s=2002.TW&d=6&e=26&f=2013&g=d&a=0&b=4&c=2000&ignore=.txt[/color]" _
- , Destination:=Range("$A$11"))
- .Name = "table.txt?s=2002.TW&d=6&e=26&f=2013&g=d&a=0&b=4&c=2000&ignore="
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .PreserveFormatting = True
- .RefreshOnFileOpen = False
- .RefreshStyle = xlInsertDeleteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .TextFilePromptOnRefresh = False
- .TextFilePlatform = 950
- .TextFileStartRow = 1
- .TextFileParseType = xlDelimited
- .TextFileTextQualifier = xlTextQualifierDoubleQuote
- .TextFileConsecutiveDelimiter = False
- .TextFileTabDelimiter = True
- .TextFileSemicolonDelimiter = False
- .TextFileCommaDelimiter = True
- .TextFileSpaceDelimiter = False
- .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1)
- .TextFileTrailingMinusNumbers = True
- .Refresh BackgroundQuery:=False
- End With
- ActiveWindow.SmallScroll Down:=-12
複製代碼 以上是錄製巨集(從文字檔插入資料)
主要是想修改紅色文字部分,想把參數值加進入,不知該如何表達會比較恰當
http://ichart.finance.yahoo.com/table.txt?s=2002.TW&d=6&e=26&f=2013&g=d&a=0&b=4&c=2000&ignore=.txt
這邊2002 想改成變數
假如變數是 I
請問要如何撰寫會比較恰當
懇請高手幫忙 |
|