Excel Sheet排序

Sub Sort_Sheets()
  Dim sCount As Integer, I As Integer, R As Integer
  ReDim Na(0) As String
  sCount = Sheets.Count
  For I = 1 To sCount
      ReDim Preserve Na(I) As String
      Na(I) = Sheets(I).Name
  Next
  For I = 1 To sCount - 1
      For R = I + 1 To sCount
          If Na(R) < Na(I) Then
             JH = Na(I)
             Na(I) = Na(R)
             Na(R) = JH
          End If
      Next
  Next
  For I = 1 To sCount
      Sheets(Na(I)).Move After:=Sheets(I)
  Next
End Sub
上一篇:AtCoder ABC177 C.Sum of product of pairs


下一篇:NA(Nirvana)公链“为应用而生” NAC公链领跑公链新格局!