|
QQ472309904 发表于 2012-9-18 16:30
能加个升序代码嘛,,就是最新开奖要显示在第10000行
这样子是倒序:
Sub test()
Cells.Clear
With ActiveSheet.QueryTables.Add(Connection:="TEXT;http://www.500wan.com/static/public/ssc/txt/opencode/29.txt", Destination:=Range("A1"))
.TextFileStartRow = 1
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1)
.Refresh BackgroundQuery:=False
End With
n = Range("a65536").End(xlUp).Row
Columns("A:G").Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("A1:A" & n), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A1:G" & n)
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
下面的是升序:
Sub test()
Cells.Clear
With ActiveSheet.QueryTables.Add(Connection:="TEXT;http://www.500wan.com/static/public/ssc/txt/opencode/29.txt", Destination:=Range("$A$1"))
.TextFileStartRow = 1
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1)
.Refresh BackgroundQuery:=False
End With
End Sub |
|