举个类似的例子,希望对你有帮助 Private Sub CommandButton1_Click()k3dshijihao = "
"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) = "投注总额" Cells(2, 12) = "单选注数"
Cells(2, 13) = "金额" Cells(2, 14) = "组三注数"
Cells(2, 15) = "金额" Cells(2, 16) = "组六注数"
Cells(2, 17) = "金额"
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, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Range("A" & (Application.Count(Range("a1:a3000")))).Select
End
标签:excel,单元格,web