|
楼主 |
发表于 2017-9-19 10:57
|
显示全部楼层
Private Sub CommandButton1_Click()
Range("A3:k12000").Clear
k3dshijihao = "http://data.917500.cn/pk10_10000.txt"
d3s = "WData3D_All"
Cells(2, 1) = "期号"
Cells(2, 2) = "冠"
Cells(2, 3) = "亚"
Cells(2, 4) = "季"
Cells(2, 5) = "四"
Cells(2, 6) = "五"
Cells(2, 7) = "六"
Cells(2, 8) = "七"
Cells(2, 9) = "八"
Cells(2, 10) = "九"
Cells(2, 11) = "十"
cz = k3dshijihao: czmc = d3s
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & cz, Destination:=Range("A3"))
.Name = czmc
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Range("A" & (Application.Count(Range("a1:a12000")))).Select
End
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
这个是我表格1的VBA数据,我用刷新模块怎么也没办法刷新出来
|
|