一个工作簿里有太多工作表,找也不好找,试试用vab代码,把工作表按拼音排序吧,方便找到工作表,本人实践了很多次,自己一直在用,工作效率提高不少 下面代码粘贴 Sub SortWorksheets() Dim SortOrd, SortM, ActiveSht As String Dim NumSht() ActiveSht = ActiveWorkbook.ActiveSheet.Name On Error Resume Next n = Sheets.Count If n = 1 Then MsgBox "只有一张工作表,无需排序!" End End If ReDim NumSht(1 To n) For i = 1 To n NumSht(i) = Sheets(i).Name Next '在此设置工作表排序方法和排序方向 'SortM = xlPinYin为按拼音顺序, 'SortOrd = xlAscending为升序, SortOrd = xlAscending SortM = xlPinYin Set sht = Sheets.Add sht.Move after:=Sheets(n + 1) sht.Visible = False With sht.Range("A1:A" & n) .NumberFormat = "@" .Value = Application.WorksheetFunction.Transpose(NumSht()) .Sort Key1:=sht.Range("A1"), Order1:=SortOrd, SortMethod:=SortM NumSht() = Application.WorksheetFunction.Transpose(.Value) End With For i = 1 To n Sheets(NumSht(i)).Move Before:=Sheets(i) Next Application.DisplayAlerts = False sht.Delete Application.DisplayAlerts = True ActiveWorkbook.Worksheets(ActiveSht).Select End Sub 代码中的SortOrd变量指定工作表的排序次序,xlAscending为升序,xlDescending为降序。SortM变量指定工作表的排序方法,xlPinYin指定工作表按拼音顺序排序,xlStroke为按笔画顺序排序。在代码中进行相应的更改即可按不同的方法和次序进行排序。 本文来源:https://www.wddqw.com/doc/109be5e7524de518964b7d42.html