AnHangPaiXu

所属分类:文件操作
开发工具:VBA
文件大小:8KB
下载次数:6
上传日期:2013-02-05 23:12:48
上 传 者dhf104109
说明:  大家都知EXCEL只能按列排序, 此代码能让EXCEL实现按行排序的功能
(Sub Macro1() Dim i As Integer For i = 2 To Sheet1.Range("a65535").End(xlUp).Row Rows(i).Select Application.CutCopyMode = False Selection.Copy Sheets("Sheet2").Select Range("A1").Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True Application.CutCopyMode = False Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _ :=xlPinYin, DataOption1:=xlSortNormal Selection.Copy Sheets("Sheet1").Select Rows(i).Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True Cells(i, 1).Select Next End Sub )

文件列表:
AnHangPaiXu.xls (28160, 2013-02-05)

近期下载者

相关文件


收藏者