联合开发网   搜索   要求与建议
                登陆    注册
排序按匹配   按投票   按下载次数   按上传日期
按分类查找All 文件操作(1) 
按平台查找All VBA(1) 

[文件操作] AnHangPaiXu

大家都知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 (2013-02-05, VBA, 8KB, 下载6次)

http://www.pudn.com/Download/item/id/2134405.html
总计:1