5楼
按了F5不能运行代码,是不是代码有问题?应该不是EXCEL的问题,因为我的其它代码可以运行,我的代码是刚从网站下载的,请帮忙看看有没有问题
Private Sub CommandButton1_Click()
Range("A3:AC3500").Clear
k3dshijihao = "http://182.92.109.149/getData/ssq.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) = "号"
Cells(2, 12) = "出"
Cells(2, 13) = "球"
Cells(2, 14) = "顺"
Cells(2, 15) = "序"
Cells(2, 16) = "投注总额"
Cells(2, 17) = "奖池金额"
Cells(2, 18) = "一等注数"
Cells(2, 19) = "一等金额"
Cells(2, 20) = "二等注数"
Cells(2, 21) = "二等金额"
Cells(2, 22) = "三等注数"
Cells(2, 23) = "金额"
Cells(2, 24) = "四等注数"
Cells(2, 25) = "金额"
Cells(2, 26) = "五等注数"
Cells(2, 27) = "金额"
Cells(2, 28) = "六等注数"
Cells(2, 29) = "金额"
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, 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
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub