返回

Excel专题问题求助

◆ 微信扫描二维码分享
◆ 手机QQ扫描二维码,点击右上角···分享到QQ好友或QQ空间
请拨打电话:4008017500

更多 关闭

论坛排列五电子表格VBA取舍求助,请老师们帮忙

xbxs

2025-09-06 16:44:57

只保留开奖期号、开奖号码,请问老师如何修改?

Private Sub CommandButton1_Click()

Range("A3:Q9900").Clear

k3dshijihao = "http://data.17500.cn/pl5_asc.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) = "单注奖金"
   
    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)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
Range("A" & (Application.Count(Range("a1:a8000")))).Select
End





End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

上一篇 下一篇

323

1